lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <805d0d65-9391-463f-9cbc-bca8dcbd5aa3@kernel.org>
Date: Thu, 22 May 2025 19:42:28 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Aaron Kling <webgeek1234@...il.com>,
 Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio: palmas: Allow building as a module

On 22/05/2025 17:52, Aaron Kling wrote:
> The driver works fine as a module, so allowing building as such. This
> drops the driver specific init in favor of the module macro which does
> the same, plus handling exit.
> 
> Signed-off-by: Aaron Kling <webgeek1234@...il.com>
> ---
>  drivers/gpio/Kconfig       |  2 +-
>  drivers/gpio/gpio-palmas.c | 10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index f2c39bbff83a33dcb12b2d32aa3ebc358a0dd949..be5d823516d0e2bff4b4231dac6a82bf10887118 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -1464,7 +1464,7 @@ config GPIO_MAX77650
>  	  These chips have a single pin that can be configured as GPIO.
>  
>  config GPIO_PALMAS
> -	bool "TI PALMAS series PMICs GPIO"
> +	tristate "TI PALMAS series PMICs GPIO"
>  	depends on MFD_PALMAS
>  	help
>  	  Select this option to enable GPIO driver for the TI PALMAS
> diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
> index 28dba7048509a3ef9c7972c1be53ea30adddabb0..c70782be502b2719bb30cf3e40065c89ecec3cc2 100644
> --- a/drivers/gpio/gpio-palmas.c
> +++ 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.

There is also no user for above alias.

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ