From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756330AbdABRkd (ORCPT ); Mon, 2 Jan 2017 12:40:33 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:34428 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755998AbdABRkV (ORCPT ); Mon, 2 Jan 2017 12:40:21 -0500 From: "Jingoo Han" To: "'Javier Martinez Canillas'" , Cc: , "'Support Opensource'" , "'Lee Jones'" , References: <1483373008-9905-1-git-send-email-javier@osg.samsung.com> In-Reply-To: <1483373008-9905-1-git-send-email-javier@osg.samsung.com> Subject: Re: [PATCH] backlight: da9052: Fix module autoload Date: Mon, 2 Jan 2017 12:40:18 -0500 Message-ID: <000901d2651f$49723a20$dc56ae60$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJ9fmlr6v5lQgSbZ0iIRborBrp9/5/PQINg Content-Language: ko Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Jingoo Han 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 "); > MODULE_DESCRIPTION("Backlight driver for DA9052 PMIC"); > MODULE_LICENSE("GPL"); > -MODULE_ALIAS("platform:da9052-backlight"); > -- > 2.7.4