* [PATCH] backlight: da9052: Fix module autoload
@ 2017-01-02 16:03 Javier Martinez Canillas
2017-01-02 17:40 ` Jingoo Han
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2017-01-02 16:03 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, linux-fbdev, Jingoo Han,
Support Opensource, Lee Jones
The driver has a platform device ID table with multiple device entries,
each setting a different register address in its driver_data to control
the WLED brightness.
But the driver doesn't export these as aliases with MODULE_DEVICE_TABLE()
when the driver is built as a module, instead it just has a single alias
using MODULE_ALIAS("platform:da9052-backlight"). That is clearly wrong
since there isn't a "da9052-backlight" in the platform device ID table,
so if that device name is used, the device won't even match the driver.
So instead of having a wrong alias, export the ones in the dev ID table.
Before this patch:
$ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
alias: platform:da9052-backlight
After this patch:
$ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
alias: platform:da9052-wled3
alias: platform:da9052-wled2
alias: platform:da9052-wled1
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/video/backlight/da9052_bl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c
index fd2be417aa64..49035c12739a 100644
--- a/drivers/video/backlight/da9052_bl.c
+++ b/drivers/video/backlight/da9052_bl.c
@@ -167,6 +167,7 @@ static const struct platform_device_id da9052_wled_ids[] = {
},
{ },
};
+MODULE_DEVICE_TABLE(platform, da9052_wled_ids);
static struct platform_driver da9052_wled_driver = {
.probe = da9052_backlight_probe,
@@ -182,4 +183,3 @@ module_platform_driver(da9052_wled_driver);
MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
MODULE_DESCRIPTION("Backlight driver for DA9052 PMIC");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:da9052-backlight");
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] backlight: da9052: Fix module autoload
2017-01-02 16:03 [PATCH] backlight: da9052: Fix module autoload Javier Martinez Canillas
@ 2017-01-02 17:40 ` Jingoo Han
2017-01-03 14:11 ` Adam Thomson
2017-01-04 11:40 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2017-01-02 17:40 UTC (permalink / raw)
To: 'Javier Martinez Canillas', linux-kernel
Cc: linux-fbdev, 'Support Opensource', 'Lee Jones',
david.chen
On Monday, January 2, 2017 11:03 AM, Javier Martinez Canillas wrote:
>
> The driver has a platform device ID table with multiple device entries,
> each setting a different register address in its driver_data to control
> the WLED brightness.
>
> But the driver doesn't export these as aliases with MODULE_DEVICE_TABLE()
> when the driver is built as a module, instead it just has a single alias
> using MODULE_ALIAS("platform:da9052-backlight"). That is clearly wrong
> since there isn't a "da9052-backlight" in the platform device ID table,
> so if that device name is used, the device won't even match the driver.
>
> So instead of having a wrong alias, export the ones in the dev ID table.
>
> Before this patch:
>
> $ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
> alias: platform:da9052-backlight
>
> After this patch:
>
> $ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
> alias: platform:da9052-wled3
> alias: platform:da9052-wled2
> alias: platform:da9052-wled1
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Best regards,
Jingoo Han
> ---
>
> drivers/video/backlight/da9052_bl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/backlight/da9052_bl.c
> b/drivers/video/backlight/da9052_bl.c
> index fd2be417aa64..49035c12739a 100644
> --- a/drivers/video/backlight/da9052_bl.c
> +++ b/drivers/video/backlight/da9052_bl.c
> @@ -167,6 +167,7 @@ static const struct platform_device_id
> da9052_wled_ids[] = {
> },
> { },
> };
> +MODULE_DEVICE_TABLE(platform, da9052_wled_ids);
>
> static struct platform_driver da9052_wled_driver = {
> .probe = da9052_backlight_probe,
> @@ -182,4 +183,3 @@ module_platform_driver(da9052_wled_driver);
> MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
> MODULE_DESCRIPTION("Backlight driver for DA9052 PMIC");
> MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:da9052-backlight");
> --
> 2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] backlight: da9052: Fix module autoload
2017-01-02 16:03 [PATCH] backlight: da9052: Fix module autoload Javier Martinez Canillas
2017-01-02 17:40 ` Jingoo Han
@ 2017-01-03 14:11 ` Adam Thomson
2017-01-04 11:40 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Adam Thomson @ 2017-01-03 14:11 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel
Cc: linux-fbdev, Jingoo Han, Support Opensource, Lee Jones
On 02 January 2017 16:03, Javier Martinez Canillas wrote:
> The driver has a platform device ID table with multiple device entries,
> each setting a different register address in its driver_data to control
> the WLED brightness.
>
> But the driver doesn't export these as aliases with MODULE_DEVICE_TABLE()
> when the driver is built as a module, instead it just has a single alias
> using MODULE_ALIAS("platform:da9052-backlight"). That is clearly wrong
> since there isn't a "da9052-backlight" in the platform device ID table,
> so if that device name is used, the device won't even match the driver.
>
> So instead of having a wrong alias, export the ones in the dev ID table.
>
> Before this patch:
>
> $ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
> alias: platform:da9052-backlight
>
> After this patch:
>
> $ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
> alias: platform:da9052-wled3
> alias: platform:da9052-wled2
> alias: platform:da9052-wled1
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] backlight: da9052: Fix module autoload
2017-01-02 16:03 [PATCH] backlight: da9052: Fix module autoload Javier Martinez Canillas
2017-01-02 17:40 ` Jingoo Han
2017-01-03 14:11 ` Adam Thomson
@ 2017-01-04 11:40 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2017-01-04 11:40 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, linux-fbdev, Jingoo Han, Support Opensource
On Mon, 02 Jan 2017, Javier Martinez Canillas wrote:
> The driver has a platform device ID table with multiple device entries,
> each setting a different register address in its driver_data to control
> the WLED brightness.
>
> But the driver doesn't export these as aliases with MODULE_DEVICE_TABLE()
> when the driver is built as a module, instead it just has a single alias
> using MODULE_ALIAS("platform:da9052-backlight"). That is clearly wrong
> since there isn't a "da9052-backlight" in the platform device ID table,
> so if that device name is used, the device won't even match the driver.
>
> So instead of having a wrong alias, export the ones in the dev ID table.
>
> Before this patch:
>
> $ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
> alias: platform:da9052-backlight
>
> After this patch:
>
> $ modinfo drivers/video/backlight/da9052_bl.ko | grep alias
> alias: platform:da9052-wled3
> alias: platform:da9052-wled2
> alias: platform:da9052-wled1
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
>
> drivers/video/backlight/da9052_bl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
> diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c
> index fd2be417aa64..49035c12739a 100644
> --- a/drivers/video/backlight/da9052_bl.c
> +++ b/drivers/video/backlight/da9052_bl.c
> @@ -167,6 +167,7 @@ static const struct platform_device_id da9052_wled_ids[] = {
> },
> { },
> };
> +MODULE_DEVICE_TABLE(platform, da9052_wled_ids);
>
> static struct platform_driver da9052_wled_driver = {
> .probe = da9052_backlight_probe,
> @@ -182,4 +183,3 @@ module_platform_driver(da9052_wled_driver);
> MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
> MODULE_DESCRIPTION("Backlight driver for DA9052 PMIC");
> MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:da9052-backlight");
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-04 11:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-02 16:03 [PATCH] backlight: da9052: Fix module autoload Javier Martinez Canillas
2017-01-02 17:40 ` Jingoo Han
2017-01-03 14:11 ` Adam Thomson
2017-01-04 11:40 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).