[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0b09b4ba-341f-4c22-a9b9-5f49f15787c4@kernel.org>
Date: Fri, 23 May 2025 08:26:50 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Aaron Kling <webgeek1234@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio: palmas: Allow building as a module
On 23/05/2025 00:04, Aaron Kling wrote:
>>> +++ b/drivers/gpio/gpio-palmas.c
>>> @@ -191,9 +191,9 @@ static struct platform_driver palmas_gpio_driver = {
>>> .driver.of_match_table = of_palmas_gpio_match,
>>> .probe = palmas_gpio_probe,
>>> };
>>> +module_platform_driver(palmas_gpio_driver);
>>>
>>> -static int __init palmas_gpio_init(void)
>>> -{
>>> - return platform_driver_register(&palmas_gpio_driver);
>>> -}
>>> -subsys_initcall(palmas_gpio_init);
>>> +MODULE_ALIAS("platform:palmas_gpio");
>>
>>
>> Drop. You miss proper MODULE_DEVICE_TABLE instead. 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 just copied from the other drivers for this mfd, like clk-palmas,
> palmas-regulator, etc. I don't know if there's a reason these others
> have aliases or not, but they all have it. I'll update this patch per
> the suggestions and send a v2.
They might be coming from old board files, so the alias was needed, but
if board files were removed then this does not apply anymore. And I
checked - no user of the alias.
Best regards,
Krzysztof
Powered by blists - more mailing lists