RE: [PATCH v5 char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch

From: Tharunkumar.Pasumarthi
Date: Tue Feb 14 2023 - 01:53:05 EST


> From: Tharunkumar Pasumarthi - I67821
> Sent: Tuesday, February 14, 2023 12:08 PM
> To: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>; linux-
> kernel@xxxxxxxxxxxxxxx
> Hi Christophe,
> Thanks for your comments.
>
> In the earlier version of patch, auxiliary_driver_unregister was done before
> unregister_blkdev.
> But Greg suggested to change it this way - "You need to unregister your block
> device _BEFORE_ the aux device goes away underneath it". Hence followed
> this order.

Since block device is a child of the aux device, it makes sense to remove block device before removing the aux_device.
So that unwinding of the device stack is done in the reverse order of creation.

Thanks,
Tharun Kumar P