From patchwork Tue Feb 9 11:08:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 8260071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 66D0B9F38B for ; Tue, 9 Feb 2016 11:11:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C88720254 for ; Tue, 9 Feb 2016 11:11:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FB7620148 for ; Tue, 9 Feb 2016 11:11:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT6AD-0000rk-T5; Tue, 09 Feb 2016 11:08:57 +0000 Received: from lists.s-osg.org ([54.187.51.154]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aT6A8-0000es-Iz; Tue, 09 Feb 2016 11:08:53 +0000 Received: from sauron.localdomain (unknown [181.120.163.117]) by lists.s-osg.org (Postfix) with ESMTPSA id E7A4946321; Tue, 9 Feb 2016 03:08:25 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH] rtc: mt6397: Add platform device ID table Date: Tue, 9 Feb 2016 08:08:14 -0300 Message-Id: <1455016095-13724-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160209_030852_798879_49C4ECCA X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alessandro Zummo , rtc-linux@googlegroups.com, Javier Martinez Canillas , linux-mediatek@lists.infradead.org, Alexandre Belloni , Eddie Huang , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The platform bus_type .match callback attempts to match the platform device name with an entry on the .id_table if provided and fallbacks to match with the driver's name if a table is not provided. Using a platform device ID to match is more explicit, allows the driver to support more than one device and also the MODULE_DEVICE_TABLE macro can be used to export the module aliases information instead of the MODULE_ALIAS. Signed-off-by: Javier Martinez Canillas Acked-by: Eddie Huang --- drivers/rtc/rtc-mt6397.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c index 06a5c52b292f..46533f11f7fc 100644 --- a/drivers/rtc/rtc-mt6397.c +++ b/drivers/rtc/rtc-mt6397.c @@ -404,6 +404,12 @@ static const struct of_device_id mt6397_rtc_of_match[] = { }; MODULE_DEVICE_TABLE(of, mt6397_rtc_of_match); +static const struct platform_device_id mt6397_rtc_id[] = { + {"mt6397-rtc", 0}, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(platform, mt6397_rtc_id); + static struct platform_driver mtk_rtc_driver = { .driver = { .name = "mt6397-rtc", @@ -412,6 +418,7 @@ static struct platform_driver mtk_rtc_driver = { }, .probe = mtk_rtc_probe, .remove = mtk_rtc_remove, + .id_table = mt6397_rtc_id, }; module_platform_driver(mtk_rtc_driver); @@ -419,4 +426,3 @@ module_platform_driver(mtk_rtc_driver); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Tianping Fang "); MODULE_DESCRIPTION("RTC Driver for MediaTek MT6397 PMIC"); -MODULE_ALIAS("platform:mt6397-rtc");