Re: [PATCH V3 2/2] pwm: Add GPIO PWM driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29/01/2024 14:55, Linus Walleij wrote:
> On Mon, Jan 29, 2024 at 10:40 AM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
>> On 28/01/2024 17:36, Stefan Wahren wrote:
> 
>>> +MODULE_ALIAS("platform:pwm-gpio");
>>
>> You should not need MODULE_ALIAS() in normal cases. If you need it,
>> usually it means your device ID table is wrong (e.g. misses either
>> entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute
>> for incomplete ID table.
> 
> I was under the impression that MODULE_ALIAS
> was something people put in to make platforms using
> udev behave better by default, e.g. autoprobing these
> devices better (on coldplug for "platform:*").
> 
> For example:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4f46d6e7e5ffbce0ee1d1a80767fdf45e56cc863
> 
> But I might have got it all wrong :/

That was 2008 :), but answering to the problem: people put MODULE_ALIAS
because they (do not have / forgot / don't want to add)* proper id table
for platform devices with MODULE_DEVICE_TABLE.

While it works, it does not offer the same scalability as proper ID
table and is confusing, because it suggests that driver should be
autoloaded by a platform ID, but not matched/bound by platform ID! Such
situation is very rare and would deserve a comment anyway.

* choose appropriate

See also:
https://lore.kernel.org/all/?q=f%3Akozlowski+drop+unneeded+module_alias


Best regards,
Krzysztof





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux