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:37:52 EST


> From: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> Sent: Sunday, February 12, 2023 1:33 PM
> To: Tharunkumar Pasumarthi - I67821
> <Tharunkumar.Pasumarthi@xxxxxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx
> Cc: linux-gpio@xxxxxxxxxxxxxxx; gregkh@xxxxxxxxxxxxxxxxxxx;
> arnd@xxxxxxxx; UNGLinuxDriver <UNGLinuxDriver@xxxxxxxxxxxxx>
> Subject: Re: [PATCH v5 char-misc-next] misc: microchip: pci1xxxx: Add
> OTP/EEPROM driver for the pci1xxxx switch
> > + unregister_blkdev(otp_block_driver_major, "OTPBlockDevice");
> > + auxiliary_driver_unregister(&pci1xxxx_otp_e2p_driver);
>
> I think it is harmless, but shouldn't it be done in the reverse order to match
> how resources have been allocated?

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.

Thanks,
Tharun Kumar P