From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756911AbcAYOhy (ORCPT ); Mon, 25 Jan 2016 09:37:54 -0500 Received: from lists.s-osg.org ([54.187.51.154]:46056 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756595AbcAYOhk (ORCPT ); Mon, 25 Jan 2016 09:37:40 -0500 From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Mark Brown , Matthias Brugger , Liam Girdwood , linux-mediatek@lists.infradead.org, John Crispin , linux-arm-kernel@lists.infradead.org, Javier Martinez Canillas Subject: [PATCH 1/2] regulator: mt6397: Add platform device ID table Date: Mon, 25 Jan 2016 11:37:15 -0300 Message-Id: <1453732637-20415-2-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453732637-20415-1-git-send-email-javier@osg.samsung.com> References: <1453732637-20415-1-git-send-email-javier@osg.samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/regulator/mt6397-regulator.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/mt6397-regulator.c b/drivers/regulator/mt6397-regulator.c index a5b2f4762677..585f0399a36b 100644 --- a/drivers/regulator/mt6397-regulator.c +++ b/drivers/regulator/mt6397-regulator.c @@ -317,11 +317,18 @@ static int mt6397_regulator_probe(struct platform_device *pdev) return 0; } +static const struct platform_device_id mt6397_platform_ids[] = { + {"mt6397-regulator", 0}, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(platform, mt6397_platform_ids); + static struct platform_driver mt6397_regulator_driver = { .driver = { .name = "mt6397-regulator", }, .probe = mt6397_regulator_probe, + .id_table = mt6397_platform_ids, }; module_platform_driver(mt6397_regulator_driver); @@ -329,4 +336,3 @@ module_platform_driver(mt6397_regulator_driver); MODULE_AUTHOR("Flora Fu "); MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6397 PMIC"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:mt6397-regulator"); -- 2.5.0