Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers
From: Andy Shevchenko
Date: Thu Mar 02 2023 - 10:47:07 EST
On Thu, Mar 02, 2023 at 09:40:09AM +0100, Henning Schild wrote:
> Am Wed, 1 Mar 2023 19:28:12 +0200
> schrieb Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>:
> > On Wed, Mar 01, 2023 at 06:02:14PM +0100, Henning Schild wrote:
...
> > > + .driver = {
> > > + .name = KBUILD_MODNAME,
> >
> > Strictly speaking this is an ABI (as something may instantiate the
> > driver from the user space or elsewhere by this name. At the same
> > time this may change with the file name change.
> >
> > Personally I prefer explicit string literal here.
>
> Switching from one module to three the names have to change. People who
> explicitly loaded the old module which supported multiple machines,
> will now how to load either both oŕ know which one to load.
Wait, are you telling that now users load modules _manually_?!
> I personally think the ABI change is acceptable, the assumption would
> be that the drivers load automatically anyhow. And since there are no
> params i doubt users will have /etc/modprobe.d/ or /sys/module/ stuff
> around.
>
> And with the split i guess an ABI change can not be fully avoided.
> Whether the names is explicit or implicit is another discussion and
> just a matter of style. I prefer to stay with the currently used
> pattern, it is not un-common in the kernel.
The problem with that pattern is possible, while unlikely, renaming of the file
which triggers this to be updated.
Under sysfs the folder will change its name. If user has a script relying on
this, it will be broken. So, I prefer mine.
> > > + },
--
With Best Regards,
Andy Shevchenko