From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbcBJQTu (ORCPT ); Wed, 10 Feb 2016 11:19:50 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36462 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbcBJQTs (ORCPT ); Wed, 10 Feb 2016 11:19:48 -0500 Date: Wed, 10 Feb 2016 16:19:44 +0000 From: Lee Jones To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: mt6397: Add platform device ID table Message-ID: <20160210161944.GI3782@x1> References: <1455016229-14072-1-git-send-email-javier@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1455016229-14072-1-git-send-email-javier@osg.samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 09 Feb 2016, Javier Martinez Canillas wrote: > 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/mfd/mt6397-core.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c > index 1749c1c9f405..11c28caf4e5a 100644 > --- a/drivers/mfd/mt6397-core.c > +++ b/drivers/mfd/mt6397-core.c > @@ -275,6 +275,12 @@ static const struct of_device_id mt6397_of_match[] = { > }; > MODULE_DEVICE_TABLE(of, mt6397_of_match); > > +static const struct platform_device_id mt6397_id[] = { > + {"mt6397", 0}, Please insert spaces at both ends. > + { /* sentinel */ }, We know what a NULL entry does. No need for the comment. > +}; > +MODULE_DEVICE_TABLE(platform, mt6397_id); > + > static struct platform_driver mt6397_driver = { > .probe = mt6397_probe, > .remove = mt6397_remove, > @@ -283,6 +289,7 @@ static struct platform_driver mt6397_driver = { > .of_match_table = of_match_ptr(mt6397_of_match), > .pm = &mt6397_pm_ops, > }, > + .id_table = mt6397_id, > }; > > module_platform_driver(mt6397_driver); > @@ -290,4 +297,3 @@ module_platform_driver(mt6397_driver); > MODULE_AUTHOR("Flora Fu, MediaTek"); > MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC"); > MODULE_LICENSE("GPL"); > -MODULE_ALIAS("platform:mt6397"); -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog