Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751518AbdFFOXt (ORCPT ); Tue, 6 Jun 2017 10:23:49 -0400 Received: from mail1.windriver.com ([147.11.146.13]:48579 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418AbdFFOXr (ORCPT ); Tue, 6 Jun 2017 10:23:47 -0400 Date: Tue, 6 Jun 2017 10:22:58 -0400 From: Paul Gortmaker To: Lee Jones CC: , Support Opensource , Eric Miao , Mike Rapoport Subject: Re: [PATCH 1/4] mfd: da903x: Make it explicitly non-modular Message-ID: <20170606142257.GE11179@windriver.com> References: <20170603130351.13913-1-paul.gortmaker@windriver.com> <20170603130351.13913-2-paul.gortmaker@windriver.com> <20170605103635.d572m5v36bwu7typ@dell> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170605103635.d572m5v36bwu7typ@dell> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3754 Lines: 114 [Re: [PATCH 1/4] mfd: da903x: Make it explicitly non-modular] On 05/06/2017 (Mon 11:36) Lee Jones wrote: > On Sat, 03 Jun 2017, Paul Gortmaker wrote: > > > The Kconfig currently controlling compilation of this code is: > > > > drivers/mfd/Kconfig:config PMIC_DA903X > > drivers/mfd/Kconfig: bool "Dialog Semiconductor DA9030/DA9034 PMIC Support" > > > > ...meaning that it currently is not being built as a module by anyone. > > > > Remove the modular code that is essentially orphaned, so that > > when reading the driver there is no doubt it is builtin-only. > > > > Also explicitly disallow a driver unbind, since that doesn't have a > > sensible use case anyway, and it allows us to drop the ".remove" > > code for non-modular drivers. > > Do this device resides only on platforms which cannot be shut down, > right? Looking at the spec, the chip is handling power routing (and audio) so it would seem that if your platform has this chip, you'd always need this code loaded and present. Paul. -- > > > Since module_init was not in use by this code, the init ordering > > remains unchanged with this commit. > > > > We replace module.h with init.h and export.h ; the latter since this > > file does export some syms. > > > > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. > > > > We also delete the MODULE_LICENSE tag etc. since all that information > > is already contained at the top of the file in the comments. > > > > Cc: Support Opensource > > Cc: Lee Jones > > Cc: Eric Miao > > Cc: Mike Rapoport > > Signed-off-by: Paul Gortmaker > > --- > > drivers/mfd/da903x.c | 26 +++----------------------- > > 1 file changed, 3 insertions(+), 23 deletions(-) > > > > diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c > > index 09f367571c58..78edb0558a0f 100644 > > --- a/drivers/mfd/da903x.c > > +++ b/drivers/mfd/da903x.c > > @@ -13,7 +13,7 @@ > > */ > > > > #include > > -#include > > +#include > > #include > > #include > > #include > > @@ -446,7 +446,6 @@ static const struct i2c_device_id da903x_id_table[] = { > > { "da9034", 1 }, > > { }, > > }; > > -MODULE_DEVICE_TABLE(i2c, da903x_id_table); > > > > static int __remove_subdev(struct device *dev, void *unused) > > { > > @@ -535,20 +534,12 @@ static int da903x_probe(struct i2c_client *client, > > return da903x_add_subdevs(chip, pdata); > > } > > > > -static int da903x_remove(struct i2c_client *client) > > -{ > > - struct da903x_chip *chip = i2c_get_clientdata(client); > > - > > - da903x_remove_subdevs(chip); > > - return 0; > > -} > > - > > static struct i2c_driver da903x_driver = { > > .driver = { > > - .name = "da903x", > > + .name = "da903x", > > + .suppress_bind_attrs = true, > > }, > > .probe = da903x_probe, > > - .remove = da903x_remove, > > .id_table = da903x_id_table, > > }; > > > > @@ -557,14 +548,3 @@ static int __init da903x_init(void) > > return i2c_add_driver(&da903x_driver); > > } > > subsys_initcall(da903x_init); > > - > > -static void __exit da903x_exit(void) > > -{ > > - i2c_del_driver(&da903x_driver); > > -} > > -module_exit(da903x_exit); > > - > > -MODULE_DESCRIPTION("PMIC Driver for Dialog Semiconductor DA9034"); > > -MODULE_AUTHOR("Eric Miao "); > > -MODULE_AUTHOR("Mike Rapoport "); > > -MODULE_LICENSE("GPL v2"); > > -- > Lee Jones > Linaro STMicroelectronics Landing Team Lead > Linaro.org │ Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog