All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Jingoo Han <jingoohan1@gmail.com>,
	Support Opensource <support.opensource@diasemi.com>
Subject: Re: [PATCH] backlight: da9052: Fix module autoload
Date: Wed, 04 Jan 2017 11:40:51 +0000	[thread overview]
Message-ID: <20170104114051.GG27589@dell> (raw)
In-Reply-To: <1483373008-9905-1-git-send-email-javier@osg.samsung.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Jingoo Han <jingoohan1@gmail.com>,
	Support Opensource <support.opensource@diasemi.com>
Subject: Re: [PATCH] backlight: da9052: Fix module autoload
Date: Wed, 4 Jan 2017 11:40:51 +0000	[thread overview]
Message-ID: <20170104114051.GG27589@dell> (raw)
In-Reply-To: <1483373008-9905-1-git-send-email-javier@osg.samsung.com>

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

  parent reply	other threads:[~2017-01-04 11:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02 16:03 [PATCH] backlight: da9052: Fix module autoload Javier Martinez Canillas
2017-01-02 16:03 ` Javier Martinez Canillas
2017-01-02 17:40 ` Jingoo Han
2017-01-02 17:40   ` Jingoo Han
2017-01-03 14:11 ` Adam Thomson
2017-01-03 14:11   ` Adam Thomson
2017-01-04 11:40 ` Lee Jones [this message]
2017-01-04 11:40   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170104114051.GG27589@dell \
    --to=lee.jones@linaro.org \
    --cc=javier@osg.samsung.com \
    --cc=jingoohan1@gmail.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.