From patchwork Mon Jan 2 16:03:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 9493843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E79B62AB3 for ; Mon, 2 Jan 2017 16:03:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31D7D24560 for ; Mon, 2 Jan 2017 16:03:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24E97266F3; Mon, 2 Jan 2017 16:03:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B14C24560 for ; Mon, 2 Jan 2017 16:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755641AbdABQDo (ORCPT ); Mon, 2 Jan 2017 11:03:44 -0500 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:57072 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751763AbdABQDn (ORCPT ); Mon, 2 Jan 2017 11:03:43 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 5F2E4A1312; Mon, 2 Jan 2017 16:03:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mrD49h1vFbmj; Mon, 2 Jan 2017 16:03:57 +0000 (UTC) Received: from minerva.localdomain (unknown [181.121.136.80]) by osg.samsung.com (Postfix) with ESMTPSA id 4BAFAA12FC; Mon, 2 Jan 2017 16:03:55 +0000 (UTC) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas , linux-fbdev@vger.kernel.org, Jingoo Han , Support Opensource , Lee Jones Subject: [PATCH] backlight: da9052: Fix module autoload Date: Mon, 2 Jan 2017 13:03:27 -0300 Message-Id: <1483373008-9905-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Adam Thomson --- 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");