* [PATCH 0/3] pinctrl: bcm/samsung/tegra: make bool code non-modular @ 2017-05-22 20:56 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Alexandre Courbot, Ashwini Ghuge, bcm-kernel-feedback-list, Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Pritesh Raithatha, Ray Jui, Scott Branden, Sherman Yin, Stefan Wahren, Stephen Warren, Thierry Reding, Thomas Abraham, Tomasz Figa, linux-gpio, linux-rpi-kernel, linux-samsung-soc This is the last of the pinctrl cleanups I have in my queue. So hopefully once these are in and any current but out-of-tree drivers are submitted, there won't be any more examples of non-modular code using modular infrastructure for people to inadvertently copy off of. Nothing really new here -- if the Kconfig and/or the Makefile does not allow building the code as modular, then we don't need to be using module_xyz() functions and/or MODULE_XYZ macros. Here we audit and remove such instances in three subdirectories of the pinctrl subsystem: bcm, samsung, and tegra, which allows us to have a positive net removal of unused code as per the diffstat. Rather than do one commit per driver, we take advantage of the fact that the drivers are grouped already and bundle the changes per family, since the changes are not really deeply technical. Build tested for allmodconfig on linux-next for arm, arm64; also explicitly compiled each file for both arch to ensure nobody got missed on the allmodconfig. (there are missing renesas_sdhi syms in today's linux-next arm but that is not caused by these changes.) Linus - thanks for your patience in merging all these to date. Paul. --- Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Ashwini Ghuge <aghuge@nvidia.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: Eric Anholt <eric@anholt.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Jon Mason <jonmason@broadcom.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Pritesh Raithatha <praithatha@nvidia.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: Sherman Yin <syin@broadcom.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: linux-gpio@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-tegra@vger.kernel.org Paul Gortmaker (3): pinctrl: samsung: clean up modular vs. non-modular distinctions pinctrl: tegra: clean up modular vs. non-modular distinctions pinctrl: bcm: clean up modular vs. non-modular distinctions drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 16 ++++++++-------- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 20 +++----------------- drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 11 +++++------ drivers/pinctrl/samsung/pinctrl-exynos.c | 1 - drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 +++------------ drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 13 +------------ drivers/pinctrl/tegra/pinctrl-tegra.c | 1 - drivers/pinctrl/tegra/pinctrl-tegra114.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra124.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra20.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra210.c | 9 ++------- drivers/pinctrl/tegra/pinctrl-tegra30.c | 11 ++++------- 14 files changed, 40 insertions(+), 94 deletions(-) -- 2.11.0 ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 0/3] pinctrl: bcm/samsung/tegra: make bool code non-modular @ 2017-05-22 20:56 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Alexandre Courbot, Ashwini Ghuge, bcm-kernel-feedback-list, Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Pritesh Raithatha, Ray Jui, Scott Branden, Sherman Yin, Stefan Wahren, Stephen Warren, Thierry Reding, Thomas Abraham, Tomasz Figa, linux-gpio, linux-rpi-kernel, linux-samsung-soc, linux-tegra This is the last of the pinctrl cleanups I have in my queue. So hopefully once these are in and any current but out-of-tree drivers are submitted, there won't be any more examples of non-modular code using modular infrastructure for people to inadvertently copy off of. Nothing really new here -- if the Kconfig and/or the Makefile does not allow building the code as modular, then we don't need to be using module_xyz() functions and/or MODULE_XYZ macros. Here we audit and remove such instances in three subdirectories of the pinctrl subsystem: bcm, samsung, and tegra, which allows us to have a positive net removal of unused code as per the diffstat. Rather than do one commit per driver, we take advantage of the fact that the drivers are grouped already and bundle the changes per family, since the changes are not really deeply technical. Build tested for allmodconfig on linux-next for arm, arm64; also explicitly compiled each file for both arch to ensure nobody got missed on the allmodconfig. (there are missing renesas_sdhi syms in today's linux-next arm but that is not caused by these changes.) Linus - thanks for your patience in merging all these to date. Paul. --- Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Ashwini Ghuge <aghuge@nvidia.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: Eric Anholt <eric@anholt.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Jon Mason <jonmason@broadcom.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Pritesh Raithatha <praithatha@nvidia.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: Sherman Yin <syin@broadcom.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: linux-gpio@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-tegra@vger.kernel.org Paul Gortmaker (3): pinctrl: samsung: clean up modular vs. non-modular distinctions pinctrl: tegra: clean up modular vs. non-modular distinctions pinctrl: bcm: clean up modular vs. non-modular distinctions drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 16 ++++++++-------- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 20 +++----------------- drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 11 +++++------ drivers/pinctrl/samsung/pinctrl-exynos.c | 1 - drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 +++------------ drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 13 +------------ drivers/pinctrl/tegra/pinctrl-tegra.c | 1 - drivers/pinctrl/tegra/pinctrl-tegra114.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra124.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra20.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra210.c | 9 ++------- drivers/pinctrl/tegra/pinctrl-tegra30.c | 11 ++++------- 14 files changed, 40 insertions(+), 94 deletions(-) -- 2.11.0 ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker @ 2017-05-22 20:56 ` Paul Gortmaker -1 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Tomasz Figa, Thomas Abraham, Linus Walleij, linux-samsung-soc, linux-gpio Fixups here tend to be more all over the map vs. some of the other repeated/systematic ones we've seen elsewhere. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h A couple drivers have module_exit() code that is essentially orphaned, and so we remove that. There are no module_init replacements, so we have no concerns wrt. initcall ordering changes as per some of the other cleanups. 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 was (or is now) contained at the top of the file in the comments. Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-samsung-soc@vger.kernel.org Cc: linux-gpio@vger.kernel.org Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/pinctrl/samsung/pinctrl-exynos.c | 1 - drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 +++------------ drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 13 +------------ 5 files changed, 6 insertions(+), 27 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 7b0e6cc35e04..70345462c7be 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -18,7 +18,6 @@ * external gpio and wakeup interrupt support. */ -#include <linux/module.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h> diff --git a/drivers/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c index 3000df80709f..32a3a9fd65c4 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c @@ -1,6 +1,8 @@ /* * pin-controller/pin-mux/pin-config/gpio-driver for Samsung's EXYNOS5440 SoC. * + * Author: Thomas Abraham <thomas.ab@samsung.com> + * * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com * @@ -10,7 +12,7 @@ * (at your option) any later version. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/slab.h> @@ -991,7 +993,6 @@ static const struct of_device_id exynos5440_pinctrl_dt_match[] = { { .compatible = "samsung,exynos5440-pinctrl" }, {}, }; -MODULE_DEVICE_TABLE(of, exynos5440_pinctrl_dt_match); static struct platform_driver exynos5440_pinctrl_driver = { .probe = exynos5440_pinctrl_probe, @@ -1007,13 +1008,3 @@ static int __init exynos5440_pinctrl_drv_register(void) return platform_driver_register(&exynos5440_pinctrl_driver); } postcore_initcall(exynos5440_pinctrl_drv_register); - -static void __exit exynos5440_pinctrl_drv_unregister(void) -{ - platform_driver_unregister(&exynos5440_pinctrl_driver); -} -module_exit(exynos5440_pinctrl_drv_unregister); - -MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>"); -MODULE_DESCRIPTION("Samsung EXYNOS5440 SoC pinctrl driver"); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c index b82a003546ae..49774851e84a 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c @@ -13,7 +13,7 @@ * external gpio and wakeup interrupt support. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h> diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c index f17890aa6e25..4a88d7446e87 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c @@ -15,7 +15,7 @@ * external gpio and wakeup interrupt support. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h> diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 96279905fcc9..51c46222f2d9 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -20,7 +20,7 @@ * and wakeup interrupts can be hooked to. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/slab.h> @@ -1221,7 +1221,6 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = { #endif {}, }; -MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match); static const struct dev_pm_ops samsung_pinctrl_pm_ops = { SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend, @@ -1243,13 +1242,3 @@ static int __init samsung_pinctrl_drv_register(void) return platform_driver_register(&samsung_pinctrl_driver); } postcore_initcall(samsung_pinctrl_drv_register); - -static void __exit samsung_pinctrl_drv_unregister(void) -{ - platform_driver_unregister(&samsung_pinctrl_driver); -} -module_exit(samsung_pinctrl_drv_unregister); - -MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>"); -MODULE_DESCRIPTION("Samsung pinctrl driver"); -MODULE_LICENSE("GPL v2"); -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions @ 2017-05-22 20:56 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Tomasz Figa, Thomas Abraham, Linus Walleij, linux-samsung-soc, linux-gpio Fixups here tend to be more all over the map vs. some of the other repeated/systematic ones we've seen elsewhere. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h A couple drivers have module_exit() code that is essentially orphaned, and so we remove that. There are no module_init replacements, so we have no concerns wrt. initcall ordering changes as per some of the other cleanups. 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 was (or is now) contained at the top of the file in the comments. Cc: Tomasz Figa <tomasz.figa@gmail.com> Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-samsung-soc@vger.kernel.org Cc: linux-gpio@vger.kernel.org Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/pinctrl/samsung/pinctrl-exynos.c | 1 - drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 +++------------ drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 13 +------------ 5 files changed, 6 insertions(+), 27 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 7b0e6cc35e04..70345462c7be 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -18,7 +18,6 @@ * external gpio and wakeup interrupt support. */ -#include <linux/module.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h> diff --git a/drivers/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c index 3000df80709f..32a3a9fd65c4 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c @@ -1,6 +1,8 @@ /* * pin-controller/pin-mux/pin-config/gpio-driver for Samsung's EXYNOS5440 SoC. * + * Author: Thomas Abraham <thomas.ab@samsung.com> + * * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com * @@ -10,7 +12,7 @@ * (at your option) any later version. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/slab.h> @@ -991,7 +993,6 @@ static const struct of_device_id exynos5440_pinctrl_dt_match[] = { { .compatible = "samsung,exynos5440-pinctrl" }, {}, }; -MODULE_DEVICE_TABLE(of, exynos5440_pinctrl_dt_match); static struct platform_driver exynos5440_pinctrl_driver = { .probe = exynos5440_pinctrl_probe, @@ -1007,13 +1008,3 @@ static int __init exynos5440_pinctrl_drv_register(void) return platform_driver_register(&exynos5440_pinctrl_driver); } postcore_initcall(exynos5440_pinctrl_drv_register); - -static void __exit exynos5440_pinctrl_drv_unregister(void) -{ - platform_driver_unregister(&exynos5440_pinctrl_driver); -} -module_exit(exynos5440_pinctrl_drv_unregister); - -MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>"); -MODULE_DESCRIPTION("Samsung EXYNOS5440 SoC pinctrl driver"); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c index b82a003546ae..49774851e84a 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c @@ -13,7 +13,7 @@ * external gpio and wakeup interrupt support. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h> diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c index f17890aa6e25..4a88d7446e87 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c @@ -15,7 +15,7 @@ * external gpio and wakeup interrupt support. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h> diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 96279905fcc9..51c46222f2d9 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -20,7 +20,7 @@ * and wakeup interrupts can be hooked to. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/slab.h> @@ -1221,7 +1221,6 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = { #endif {}, }; -MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match); static const struct dev_pm_ops samsung_pinctrl_pm_ops = { SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend, @@ -1243,13 +1242,3 @@ static int __init samsung_pinctrl_drv_register(void) return platform_driver_register(&samsung_pinctrl_driver); } postcore_initcall(samsung_pinctrl_drv_register); - -static void __exit samsung_pinctrl_drv_unregister(void) -{ - platform_driver_unregister(&samsung_pinctrl_driver); -} -module_exit(samsung_pinctrl_drv_unregister); - -MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>"); -MODULE_DESCRIPTION("Samsung pinctrl driver"); -MODULE_LICENSE("GPL v2"); -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker (?) @ 2017-05-23 14:51 ` Krzysztof Kozlowski 2017-05-23 15:54 ` Paul Gortmaker -1 siblings, 1 reply; 26+ messages in thread From: Krzysztof Kozlowski @ 2017-05-23 14:51 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel, Tomasz Figa, Thomas Abraham, Linus Walleij, linux-samsung-soc, linux-gpio On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker <paul.gortmaker@windriver.com> wrote: > Fixups here tend to be more all over the map vs. some of the other > repeated/systematic ones we've seen elsewhere. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h > > A couple drivers have module_exit() code that is essentially orphaned, > and so we remove that. > > There are no module_init replacements, so we have no concerns wrt. > initcall ordering changes as per some of the other cleanups. > > 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 > was (or is now) contained at the top of the file in the comments. > > Cc: Tomasz Figa <tomasz.figa@gmail.com> > Cc: Thomas Abraham <thomas.ab@samsung.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: linux-samsung-soc@vger.kernel.org > Cc: linux-gpio@vger.kernel.org > Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> These are quite old entries of maintainers. I guess you add Cc-entries once per git commit but no problem - I have it from the lists. Thanks, applied. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions 2017-05-23 14:51 ` Krzysztof Kozlowski @ 2017-05-23 15:54 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-23 15:54 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: linux-kernel, Tomasz Figa, Thomas Abraham, Linus Walleij, linux-samsung-soc, linux-gpio [Re: [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions] On 23/05/2017 (Tue 16:51) Krzysztof Kozlowski wrote: > On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker > <paul.gortmaker@windriver.com> wrote: > > Fixups here tend to be more all over the map vs. some of the other > > repeated/systematic ones we've seen elsewhere. > > > > We remove module.h from code that isn't doing anything modular at > > all; if they have __init sections, then replace it with init.h > > > > A couple drivers have module_exit() code that is essentially orphaned, > > and so we remove that. > > > > There are no module_init replacements, so we have no concerns wrt. > > initcall ordering changes as per some of the other cleanups. > > > > 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 > > was (or is now) contained at the top of the file in the comments. > > > > Cc: Tomasz Figa <tomasz.figa@gmail.com> > > Cc: Thomas Abraham <thomas.ab@samsung.com> > > Cc: Linus Walleij <linus.walleij@linaro.org> > > Cc: linux-samsung-soc@vger.kernel.org > > Cc: linux-gpio@vger.kernel.org > > Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > > These are quite old entries of maintainers. I guess you add Cc-entries > once per git commit but no problem - I have it from the lists. Actually what happend is it got sent quite some time ago, but Linus didn't merge it because he wanted some Acks[1] and a resend. Shortly after Sylwester provided an ack. So with that in mind, I decided to restart with the most simple pinctrl patches 1st, and hence it took a while to finally get back to this one in the final series. But I didn't want to change an ack'd patch. Not that it matters, but just in case you were curious. Thanks, Paul. [1] https://marc.info/?l=linux-kernel&m=145803185919692&w=2 > > Thanks, applied. > > Best regards, Krzysztof ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions @ 2017-05-23 15:54 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-23 15:54 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: linux-kernel, Tomasz Figa, Thomas Abraham, Linus Walleij, linux-samsung-soc, linux-gpio [Re: [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions] On 23/05/2017 (Tue 16:51) Krzysztof Kozlowski wrote: > On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker > <paul.gortmaker@windriver.com> wrote: > > Fixups here tend to be more all over the map vs. some of the other > > repeated/systematic ones we've seen elsewhere. > > > > We remove module.h from code that isn't doing anything modular at > > all; if they have __init sections, then replace it with init.h > > > > A couple drivers have module_exit() code that is essentially orphaned, > > and so we remove that. > > > > There are no module_init replacements, so we have no concerns wrt. > > initcall ordering changes as per some of the other cleanups. > > > > 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 > > was (or is now) contained at the top of the file in the comments. > > > > Cc: Tomasz Figa <tomasz.figa@gmail.com> > > Cc: Thomas Abraham <thomas.ab@samsung.com> > > Cc: Linus Walleij <linus.walleij@linaro.org> > > Cc: linux-samsung-soc@vger.kernel.org > > Cc: linux-gpio@vger.kernel.org > > Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > > These are quite old entries of maintainers. I guess you add Cc-entries > once per git commit but no problem - I have it from the lists. Actually what happend is it got sent quite some time ago, but Linus didn't merge it because he wanted some Acks[1] and a resend. Shortly after Sylwester provided an ack. So with that in mind, I decided to restart with the most simple pinctrl patches 1st, and hence it took a while to finally get back to this one in the final series. But I didn't want to change an ack'd patch. Not that it matters, but just in case you were curious. Thanks, Paul. [1] https://marc.info/?l=linux-kernel&m=145803185919692&w=2 > > Thanks, applied. > > Best regards, Krzysztof ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker (?) (?) @ 2017-05-29 8:24 ` Linus Walleij -1 siblings, 0 replies; 26+ messages in thread From: Linus Walleij @ 2017-05-29 8:24 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel, Tomasz Figa, Thomas Abraham, linux-samsung-soc, linux-gpio On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker <paul.gortmaker@windriver.com> wrote: > Fixups here tend to be more all over the map vs. some of the other > repeated/systematic ones we've seen elsewhere. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h > > A couple drivers have module_exit() code that is essentially orphaned, > and so we remove that. > > There are no module_init replacements, so we have no concerns wrt. > initcall ordering changes as per some of the other cleanups. > > 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 > was (or is now) contained at the top of the file in the comments. > > Cc: Tomasz Figa <tomasz.figa@gmail.com> > Cc: Thomas Abraham <thomas.ab@samsung.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: linux-samsung-soc@vger.kernel.org > Cc: linux-gpio@vger.kernel.org > Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Krzysztof is sub-submainter for the Samsung stuff in pinctrl so I leave it to him to figure out how to bend, twist and merge this, then I will get the result back from him with a pull request. It looks good to me though. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker @ 2017-05-22 20:56 ` Paul Gortmaker -1 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel Fixups here tend to be more of a conglomerate of some of the other repeated/systematic ones we've seen in the earlier pinctrl cleanups. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h One driver has a .remove that would be dispatched on module_exit, and as that code is essentially orphaned, so we remove it. In case anyone was previously doing the (pointless) unbind to get to that function, we disable unbind for this one driver as well. A couple bool drivers (hence non-modular) are converted over to to builtin_platform_driver(). Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. 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 was (or is now) contained at the top of the file in the comments. Cc: Eric Anholt <eric@anholt.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Jon Mason <jonmason@broadcom.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Sherman Yin <syin@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-gpio@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 16 ++++++++-------- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 20 +++----------------- drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 11 +++++------ 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c index 810a81786f62..e630f4d5f4c7 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c @@ -1,4 +1,10 @@ /* + * Broadcom BCM281xx pinctrl driver + * + * Author(s): + * Sherman Yin <syin@broadcom.com> + * Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com> + * * Copyright (C) 2013 Broadcom Corporation * * This program is free software; you can redistribute it and/or @@ -12,7 +18,7 @@ */ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1444,10 +1450,4 @@ static struct platform_driver bcm281xx_pinctrl_driver = { .of_match_table = bcm281xx_pinctrl_of_match, }, }; - -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); - -MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); -MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); -MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 85d009112864..1eb7a1a5a4bb 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -27,7 +27,7 @@ #include <linux/io.h> #include <linux/irq.h> #include <linux/irqdesc.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of_address.h> #include <linux/of.h> #include <linux/of_irq.h> @@ -1075,31 +1075,17 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) return 0; } -static int bcm2835_pinctrl_remove(struct platform_device *pdev) -{ - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); - - gpiochip_remove(&pc->gpio_chip); - - return 0; -} - static const struct of_device_id bcm2835_pinctrl_match[] = { { .compatible = "brcm,bcm2835-gpio" }, {} }; -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); static struct platform_driver bcm2835_pinctrl_driver = { .probe = bcm2835_pinctrl_probe, - .remove = bcm2835_pinctrl_remove, .driver = { .name = MODULE_NAME, .of_match_table = bcm2835_pinctrl_match, + .suppress_bind_attrs = true, }, }; -module_platform_driver(bcm2835_pinctrl_driver); - -MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); -MODULE_DESCRIPTION("BCM2835 Pin control driver"); -MODULE_LICENSE("GPL"); +builtin_platform_driver(bcm2835_pinctrl_driver); diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c index d31c95701a92..3684cca277ad 100644 --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c @@ -1,4 +1,8 @@ -/* Copyright (C) 2014-2015 Broadcom Corporation +/* + * Broadcom Cygnus IOMUX driver + * + * Author: Ray Jui <rjui@broadcom.com> + * Copyright (C) 2014-2015 Broadcom Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -17,7 +21,6 @@ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/slab.h> #include <linux/platform_device.h> @@ -1016,7 +1019,3 @@ static int __init cygnus_pinmux_init(void) return platform_driver_register(&cygnus_pinmux_driver); } arch_initcall(cygnus_pinmux_init); - -MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); -MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); -MODULE_LICENSE("GPL v2"); -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions @ 2017-05-22 20:56 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel Fixups here tend to be more of a conglomerate of some of the other repeated/systematic ones we've seen in the earlier pinctrl cleanups. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h One driver has a .remove that would be dispatched on module_exit, and as that code is essentially orphaned, so we remove it. In case anyone was previously doing the (pointless) unbind to get to that function, we disable unbind for this one driver as well. A couple bool drivers (hence non-modular) are converted over to to builtin_platform_driver(). Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. 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 was (or is now) contained at the top of the file in the comments. Cc: Eric Anholt <eric@anholt.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Jon Mason <jonmason@broadcom.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Sherman Yin <syin@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-gpio@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 16 ++++++++-------- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 20 +++----------------- drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 11 +++++------ 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c index 810a81786f62..e630f4d5f4c7 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c @@ -1,4 +1,10 @@ /* + * Broadcom BCM281xx pinctrl driver + * + * Author(s): + * Sherman Yin <syin@broadcom.com> + * Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com> + * * Copyright (C) 2013 Broadcom Corporation * * This program is free software; you can redistribute it and/or @@ -12,7 +18,7 @@ */ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1444,10 +1450,4 @@ static struct platform_driver bcm281xx_pinctrl_driver = { .of_match_table = bcm281xx_pinctrl_of_match, }, }; - -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); - -MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); -MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); -MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 85d009112864..1eb7a1a5a4bb 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -27,7 +27,7 @@ #include <linux/io.h> #include <linux/irq.h> #include <linux/irqdesc.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of_address.h> #include <linux/of.h> #include <linux/of_irq.h> @@ -1075,31 +1075,17 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) return 0; } -static int bcm2835_pinctrl_remove(struct platform_device *pdev) -{ - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); - - gpiochip_remove(&pc->gpio_chip); - - return 0; -} - static const struct of_device_id bcm2835_pinctrl_match[] = { { .compatible = "brcm,bcm2835-gpio" }, {} }; -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); static struct platform_driver bcm2835_pinctrl_driver = { .probe = bcm2835_pinctrl_probe, - .remove = bcm2835_pinctrl_remove, .driver = { .name = MODULE_NAME, .of_match_table = bcm2835_pinctrl_match, + .suppress_bind_attrs = true, }, }; -module_platform_driver(bcm2835_pinctrl_driver); - -MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); -MODULE_DESCRIPTION("BCM2835 Pin control driver"); -MODULE_LICENSE("GPL"); +builtin_platform_driver(bcm2835_pinctrl_driver); diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c index d31c95701a92..3684cca277ad 100644 --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c @@ -1,4 +1,8 @@ -/* Copyright (C) 2014-2015 Broadcom Corporation +/* + * Broadcom Cygnus IOMUX driver + * + * Author: Ray Jui <rjui@broadcom.com> + * Copyright (C) 2014-2015 Broadcom Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -17,7 +21,6 @@ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/slab.h> #include <linux/platform_device.h> @@ -1016,7 +1019,3 @@ static int __init cygnus_pinmux_init(void) return platform_driver_register(&cygnus_pinmux_driver); } arch_initcall(cygnus_pinmux_init); - -MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); -MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); -MODULE_LICENSE("GPL v2"); -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker (?) @ 2017-05-23 20:11 ` Stefan Wahren -1 siblings, 0 replies; 26+ messages in thread From: Stefan Wahren @ 2017-05-23 20:11 UTC (permalink / raw) To: Paul Gortmaker Cc: Linus Walleij, Scott Branden, Ray Jui, Eric Anholt, bcm-kernel-feedback-list, linux-gpio, Florian Fainelli, linux-rpi-kernel, linux-kernel, Jon Mason, Sherman Yin > Paul Gortmaker <paul.gortmaker@windriver.com> hat am 22. Mai 2017 um 22:56 geschrieben: > > > Fixups here tend to be more of a conglomerate of some of the other > repeated/systematic ones we've seen in the earlier pinctrl cleanups. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h > > One driver has a .remove that would be dispatched on module_exit, > and as that code is essentially orphaned, so we remove it. In case > anyone was previously doing the (pointless) unbind to get to that > function, we disable unbind for this one driver as well. > > A couple bool drivers (hence non-modular) are converted over to > to builtin_platform_driver(). > > Since module_platform_driver() uses the same init level priority as > builtin_platform_driver() the init ordering remains unchanged with > this commit. > > 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 > was (or is now) contained at the top of the file in the comments. > > Cc: Eric Anholt <eric@anholt.net> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Jon Mason <jonmason@broadcom.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Ray Jui <rjui@broadcom.com> > Cc: Scott Branden <sbranden@broadcom.com> > Cc: Stefan Wahren <stefan.wahren@i2se.com> > Cc: Sherman Yin <syin@broadcom.com> > Cc: bcm-kernel-feedback-list@broadcom.com > Cc: linux-gpio@vger.kernel.org > Cc: linux-rpi-kernel@lists.infradead.org > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > --- > drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 16 ++++++++-------- > drivers/pinctrl/bcm/pinctrl-bcm2835.c | 20 +++----------------- Tested-by: Stefan Wahren <stefan.wahren@i2se.com> for pinctrl-bcm2835 ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker (?) (?) @ 2017-05-23 22:15 ` Scott Branden 2017-05-24 0:12 ` Paul Gortmaker -1 siblings, 1 reply; 26+ messages in thread From: Scott Branden @ 2017-05-23 22:15 UTC (permalink / raw) To: Paul Gortmaker, linux-kernel Cc: Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel Hi Paul, Some comments - leave our file headers intact. If you want to add a new comment do so after the existing file header in another comment. But, I don't think any of that information is needed by us. On 17-05-22 01:56 PM, Paul Gortmaker wrote: > Fixups here tend to be more of a conglomerate of some of the other > repeated/systematic ones we've seen in the earlier pinctrl cleanups. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h > > One driver has a .remove that would be dispatched on module_exit, > and as that code is essentially orphaned, so we remove it. In case > anyone was previously doing the (pointless) unbind to get to that > function, we disable unbind for this one driver as well. > > A couple bool drivers (hence non-modular) are converted over to > to builtin_platform_driver(). > > Since module_platform_driver() uses the same init level priority as > builtin_platform_driver() the init ordering remains unchanged with > this commit. > > 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 > was (or is now) contained at the top of the file in the comments. > > Cc: Eric Anholt <eric@anholt.net> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Jon Mason <jonmason@broadcom.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Ray Jui <rjui@broadcom.com> > Cc: Scott Branden <sbranden@broadcom.com> > Cc: Stefan Wahren <stefan.wahren@i2se.com> > Cc: Sherman Yin <syin@broadcom.com> > Cc: bcm-kernel-feedback-list@broadcom.com > Cc: linux-gpio@vger.kernel.org > Cc: linux-rpi-kernel@lists.infradead.org > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > --- > drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 16 ++++++++-------- > drivers/pinctrl/bcm/pinctrl-bcm2835.c | 20 +++----------------- > drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 11 +++++------ > 3 files changed, 16 insertions(+), 31 deletions(-) > > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > index 810a81786f62..e630f4d5f4c7 100644 > --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > @@ -1,4 +1,10 @@ > /* > + * Broadcom BCM281xx pinctrl driver > + * > + * Author(s): > + * Sherman Yin <syin@broadcom.com> > + * Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com> > + * Please do not add anything to the header above - leave it as is. > * Copyright (C) 2013 Broadcom Corporation > * > * This program is free software; you can redistribute it and/or > @@ -12,7 +18,7 @@ > */ > #include <linux/err.h> > #include <linux/io.h> > -#include <linux/module.h> > +#include <linux/init.h> > #include <linux/of.h> > #include <linux/platform_device.h> > #include <linux/pinctrl/pinctrl.h> > @@ -1444,10 +1450,4 @@ static struct platform_driver bcm281xx_pinctrl_driver = { > .of_match_table = bcm281xx_pinctrl_of_match, > }, > }; > - > -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); > - > -MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); > -MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); > -MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); > -MODULE_LICENSE("GPL v2"); Fine to remove this if it's not need any more. > +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > index 85d009112864..1eb7a1a5a4bb 100644 > --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c > +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > @@ -27,7 +27,7 @@ > #include <linux/io.h> > #include <linux/irq.h> > #include <linux/irqdesc.h> > -#include <linux/module.h> > +#include <linux/init.h> > #include <linux/of_address.h> > #include <linux/of.h> > #include <linux/of_irq.h> > @@ -1075,31 +1075,17 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) > return 0; > } > > -static int bcm2835_pinctrl_remove(struct platform_device *pdev) > -{ > - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); > - > - gpiochip_remove(&pc->gpio_chip); > - > - return 0; > -} > - > static const struct of_device_id bcm2835_pinctrl_match[] = { > { .compatible = "brcm,bcm2835-gpio" }, > {} > }; > -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); > > static struct platform_driver bcm2835_pinctrl_driver = { > .probe = bcm2835_pinctrl_probe, > - .remove = bcm2835_pinctrl_remove, > .driver = { > .name = MODULE_NAME, > .of_match_table = bcm2835_pinctrl_match, > + .suppress_bind_attrs = true, > }, > }; > -module_platform_driver(bcm2835_pinctrl_driver); > - > -MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); > -MODULE_DESCRIPTION("BCM2835 Pin control driver"); > -MODULE_LICENSE("GPL"); > +builtin_platform_driver(bcm2835_pinctrl_driver); > diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > index d31c95701a92..3684cca277ad 100644 > --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > @@ -1,4 +1,8 @@ > -/* Copyright (C) 2014-2015 Broadcom Corporation > +/* > + * Broadcom Cygnus IOMUX driver > + * > + * Author: Ray Jui <rjui@broadcom.com> > + * Copyright (C) 2014-2015 Broadcom Corporation Please do not add any of the above to the file header. > * > * This program is free software; you can redistribute it and/or > * modify it under the terms of the GNU General Public License as > @@ -17,7 +21,6 @@ > > #include <linux/err.h> > #include <linux/io.h> > -#include <linux/module.h> > #include <linux/of.h> > #include <linux/slab.h> > #include <linux/platform_device.h> > @@ -1016,7 +1019,3 @@ static int __init cygnus_pinmux_init(void) > return platform_driver_register(&cygnus_pinmux_driver); > } > arch_initcall(cygnus_pinmux_init); > - > -MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); > -MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); > -MODULE_LICENSE("GPL v2"); Fine with this modification. Thanks, scott ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-23 22:15 ` Scott Branden @ 2017-05-24 0:12 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-24 0:12 UTC (permalink / raw) To: Scott Branden Cc: linux-kernel, Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel [Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions] On 23/05/2017 (Tue 15:15) Scott Branden wrote: > Hi Paul, > > Some comments - leave our file headers intact. If you want to add a new > comment do so after the existing file header in another comment. But, I > don't think any of that information is needed by us. OK, no problem, if that is what is desired for your driver. I just normally move the author information from the bottom of the file to the top of the file. As a lot of the linux driver work was (is?) done for kudos and not for career, I can't just delete author information. That would not be fair to most of those contributors. It hasn't been a problem before in all of the other similar commits I've made, but I can imagine a tool that does a check on the comment block on the top of a file and complains if it changes, or similar. Would you prefer something like this instead? It leaves your header completely untouched, and still gives credit to the original author, and those lines are also untouched. I've not re-done build coverage on this yet, but let me know if this is what you'd prefer. Thanks, Paul -- From 3f8bf38bcdbf38484182222965aac2748cc1d5cd Mon Sep 17 00:00:00 2001 From: Paul Gortmaker <paul.gortmaker@windriver.com> Date: Mon, 31 Aug 2015 17:35:47 -0400 Subject: [PATCH] pinctrl: bcm: clean up modular vs. non-modular distinctions Fixups here tend to be more of a conglomerate of some of the other repeated/systematic ones we've seen in the earlier pinctrl cleanups. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h One driver has a .remove that would be dispatched on module_exit, and as that code is essentially orphaned, so we remove it. In case anyone was previously doing the (pointless) unbind to get to that function, we disable unbind for this one driver as well. A couple bool drivers (hence non-modular) are converted over to to builtin_platform_driver(). Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We leave the MODULE_AUTHOR and MODULE_LICENSE tag etc. at the bottom of the file since Broadcom would prefer the comment block at the top of the file remain unchanged. We just use CPP to take it out of the picture with an #if 0 / #endif instead. Cc: Eric Anholt <eric@anholt.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Jon Mason <jonmason@broadcom.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Sherman Yin <syin@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-gpio@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 7 ++++--- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 18 +++++------------- drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 3 ++- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c index 810a81786f62..cc01acc988d0 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c @@ -12,7 +12,7 @@ */ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1444,10 +1444,11 @@ static struct platform_driver bcm281xx_pinctrl_driver = { .of_match_table = bcm281xx_pinctrl_of_match, }, }; +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); - +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); MODULE_LICENSE("GPL v2"); +#endif diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 85d009112864..3924ff17e955 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -27,7 +27,7 @@ #include <linux/io.h> #include <linux/irq.h> #include <linux/irqdesc.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of_address.h> #include <linux/of.h> #include <linux/of_irq.h> @@ -1075,31 +1075,23 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) return 0; } -static int bcm2835_pinctrl_remove(struct platform_device *pdev) -{ - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); - - gpiochip_remove(&pc->gpio_chip); - - return 0; -} - static const struct of_device_id bcm2835_pinctrl_match[] = { { .compatible = "brcm,bcm2835-gpio" }, {} }; -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); static struct platform_driver bcm2835_pinctrl_driver = { .probe = bcm2835_pinctrl_probe, - .remove = bcm2835_pinctrl_remove, .driver = { .name = MODULE_NAME, .of_match_table = bcm2835_pinctrl_match, + .suppress_bind_attrs = true, }, }; -module_platform_driver(bcm2835_pinctrl_driver); +builtin_platform_driver(bcm2835_pinctrl_driver); +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); MODULE_DESCRIPTION("BCM2835 Pin control driver"); MODULE_LICENSE("GPL"); +#endif diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c index d31c95701a92..84c2a182a5b7 100644 --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c @@ -17,7 +17,6 @@ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/slab.h> #include <linux/platform_device.h> @@ -1017,6 +1016,8 @@ static int __init cygnus_pinmux_init(void) } arch_initcall(cygnus_pinmux_init); +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); MODULE_LICENSE("GPL v2"); +#endif -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions @ 2017-05-24 0:12 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-24 0:12 UTC (permalink / raw) To: Scott Branden Cc: linux-kernel, Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel [Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions] On 23/05/2017 (Tue 15:15) Scott Branden wrote: > Hi Paul, > > Some comments - leave our file headers intact. If you want to add a new > comment do so after the existing file header in another comment. But, I > don't think any of that information is needed by us. OK, no problem, if that is what is desired for your driver. I just normally move the author information from the bottom of the file to the top of the file. As a lot of the linux driver work was (is?) done for kudos and not for career, I can't just delete author information. That would not be fair to most of those contributors. It hasn't been a problem before in all of the other similar commits I've made, but I can imagine a tool that does a check on the comment block on the top of a file and complains if it changes, or similar. Would you prefer something like this instead? It leaves your header completely untouched, and still gives credit to the original author, and those lines are also untouched. I've not re-done build coverage on this yet, but let me know if this is what you'd prefer. Thanks, Paul -- From 3f8bf38bcdbf38484182222965aac2748cc1d5cd Mon Sep 17 00:00:00 2001 From: Paul Gortmaker <paul.gortmaker@windriver.com> Date: Mon, 31 Aug 2015 17:35:47 -0400 Subject: [PATCH] pinctrl: bcm: clean up modular vs. non-modular distinctions Fixups here tend to be more of a conglomerate of some of the other repeated/systematic ones we've seen in the earlier pinctrl cleanups. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h One driver has a .remove that would be dispatched on module_exit, and as that code is essentially orphaned, so we remove it. In case anyone was previously doing the (pointless) unbind to get to that function, we disable unbind for this one driver as well. A couple bool drivers (hence non-modular) are converted over to to builtin_platform_driver(). Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We leave the MODULE_AUTHOR and MODULE_LICENSE tag etc. at the bottom of the file since Broadcom would prefer the comment block at the top of the file remain unchanged. We just use CPP to take it out of the picture with an #if 0 / #endif instead. Cc: Eric Anholt <eric@anholt.net> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Jon Mason <jonmason@broadcom.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Sherman Yin <syin@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-gpio@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 7 ++++--- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 18 +++++------------- drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 3 ++- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c index 810a81786f62..cc01acc988d0 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c @@ -12,7 +12,7 @@ */ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1444,10 +1444,11 @@ static struct platform_driver bcm281xx_pinctrl_driver = { .of_match_table = bcm281xx_pinctrl_of_match, }, }; +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); - +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); MODULE_LICENSE("GPL v2"); +#endif diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 85d009112864..3924ff17e955 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -27,7 +27,7 @@ #include <linux/io.h> #include <linux/irq.h> #include <linux/irqdesc.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of_address.h> #include <linux/of.h> #include <linux/of_irq.h> @@ -1075,31 +1075,23 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) return 0; } -static int bcm2835_pinctrl_remove(struct platform_device *pdev) -{ - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); - - gpiochip_remove(&pc->gpio_chip); - - return 0; -} - static const struct of_device_id bcm2835_pinctrl_match[] = { { .compatible = "brcm,bcm2835-gpio" }, {} }; -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); static struct platform_driver bcm2835_pinctrl_driver = { .probe = bcm2835_pinctrl_probe, - .remove = bcm2835_pinctrl_remove, .driver = { .name = MODULE_NAME, .of_match_table = bcm2835_pinctrl_match, + .suppress_bind_attrs = true, }, }; -module_platform_driver(bcm2835_pinctrl_driver); +builtin_platform_driver(bcm2835_pinctrl_driver); +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); MODULE_DESCRIPTION("BCM2835 Pin control driver"); MODULE_LICENSE("GPL"); +#endif diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c index d31c95701a92..84c2a182a5b7 100644 --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c @@ -17,7 +17,6 @@ #include <linux/err.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/slab.h> #include <linux/platform_device.h> @@ -1017,6 +1016,8 @@ static int __init cygnus_pinmux_init(void) } arch_initcall(cygnus_pinmux_init); +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); MODULE_LICENSE("GPL v2"); +#endif -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-24 0:12 ` Paul Gortmaker (?) @ 2017-05-24 0:25 ` Florian Fainelli 2017-05-24 0:37 ` Scott Branden -1 siblings, 1 reply; 26+ messages in thread From: Florian Fainelli @ 2017-05-24 0:25 UTC (permalink / raw) To: Paul Gortmaker, Scott Branden Cc: linux-kernel, Eric Anholt, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel On 05/23/2017 05:12 PM, Paul Gortmaker wrote: > [Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions] On 23/05/2017 (Tue 15:15) Scott Branden wrote: > >> Hi Paul, >> >> Some comments - leave our file headers intact. If you want to add a new >> comment do so after the existing file header in another comment. But, I >> don't think any of that information is needed by us. > > OK, no problem, if that is what is desired for your driver. I just > normally move the author information from the bottom of the file to the > top of the file. As a lot of the linux driver work was (is?) done for > kudos and not for career, I can't just delete author information. That > would not be fair to most of those contributors. > > It hasn't been a problem before in all of the other similar commits I've > made, but I can imagine a tool that does a check on the comment block on > the top of a file and complains if it changes, or similar. > > Would you prefer something like this instead? It leaves your header > completely untouched, and still gives credit to the original author, > and those lines are also untouched. This looks horrible, sorry. Scott, what's the matter with moving the authors listed in MODULE_AUTHOR() into the header? If it was up to me, I would just remove the MODULE_* parts and if I need to look up the author, git log is my friend. > > I've not re-done build coverage on this yet, but let me know if this is > what you'd prefer. > > Thanks, > Paul > -- > > From 3f8bf38bcdbf38484182222965aac2748cc1d5cd Mon Sep 17 00:00:00 2001 > From: Paul Gortmaker <paul.gortmaker@windriver.com> > Date: Mon, 31 Aug 2015 17:35:47 -0400 > Subject: [PATCH] pinctrl: bcm: clean up modular vs. non-modular distinctions > > Fixups here tend to be more of a conglomerate of some of the other > repeated/systematic ones we've seen in the earlier pinctrl cleanups. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h > > One driver has a .remove that would be dispatched on module_exit, > and as that code is essentially orphaned, so we remove it. In case > anyone was previously doing the (pointless) unbind to get to that > function, we disable unbind for this one driver as well. > > A couple bool drivers (hence non-modular) are converted over to > to builtin_platform_driver(). > > Since module_platform_driver() uses the same init level priority as > builtin_platform_driver() the init ordering remains unchanged with > this commit. > > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. > > We leave the MODULE_AUTHOR and MODULE_LICENSE tag etc. at the bottom > of the file since Broadcom would prefer the comment block at the top > of the file remain unchanged. We just use CPP to take it out of the > picture with an #if 0 / #endif instead. > > Cc: Eric Anholt <eric@anholt.net> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Jon Mason <jonmason@broadcom.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Ray Jui <rjui@broadcom.com> > Cc: Scott Branden <sbranden@broadcom.com> > Cc: Stefan Wahren <stefan.wahren@i2se.com> > Cc: Sherman Yin <syin@broadcom.com> > Cc: bcm-kernel-feedback-list@broadcom.com > Cc: linux-gpio@vger.kernel.org > Cc: linux-rpi-kernel@lists.infradead.org > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > --- > drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 7 ++++--- > drivers/pinctrl/bcm/pinctrl-bcm2835.c | 18 +++++------------- > drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 3 ++- > 3 files changed, 11 insertions(+), 17 deletions(-) > > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > index 810a81786f62..cc01acc988d0 100644 > --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > @@ -12,7 +12,7 @@ > */ > #include <linux/err.h> > #include <linux/io.h> > -#include <linux/module.h> > +#include <linux/init.h> > #include <linux/of.h> > #include <linux/platform_device.h> > #include <linux/pinctrl/pinctrl.h> > @@ -1444,10 +1444,11 @@ static struct platform_driver bcm281xx_pinctrl_driver = { > .of_match_table = bcm281xx_pinctrl_of_match, > }, > }; > +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); > > -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); > - > +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ > MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); > MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); > MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); > MODULE_LICENSE("GPL v2"); > +#endif > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > index 85d009112864..3924ff17e955 100644 > --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c > +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > @@ -27,7 +27,7 @@ > #include <linux/io.h> > #include <linux/irq.h> > #include <linux/irqdesc.h> > -#include <linux/module.h> > +#include <linux/init.h> > #include <linux/of_address.h> > #include <linux/of.h> > #include <linux/of_irq.h> > @@ -1075,31 +1075,23 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) > return 0; > } > > -static int bcm2835_pinctrl_remove(struct platform_device *pdev) > -{ > - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); > - > - gpiochip_remove(&pc->gpio_chip); > - > - return 0; > -} > - > static const struct of_device_id bcm2835_pinctrl_match[] = { > { .compatible = "brcm,bcm2835-gpio" }, > {} > }; > -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); > > static struct platform_driver bcm2835_pinctrl_driver = { > .probe = bcm2835_pinctrl_probe, > - .remove = bcm2835_pinctrl_remove, > .driver = { > .name = MODULE_NAME, > .of_match_table = bcm2835_pinctrl_match, > + .suppress_bind_attrs = true, > }, > }; > -module_platform_driver(bcm2835_pinctrl_driver); > +builtin_platform_driver(bcm2835_pinctrl_driver); > > +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ > MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); > MODULE_DESCRIPTION("BCM2835 Pin control driver"); > MODULE_LICENSE("GPL"); > +#endif > diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > index d31c95701a92..84c2a182a5b7 100644 > --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > @@ -17,7 +17,6 @@ > > #include <linux/err.h> > #include <linux/io.h> > -#include <linux/module.h> > #include <linux/of.h> > #include <linux/slab.h> > #include <linux/platform_device.h> > @@ -1017,6 +1016,8 @@ static int __init cygnus_pinmux_init(void) > } > arch_initcall(cygnus_pinmux_init); > > +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ > MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); > MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); > MODULE_LICENSE("GPL v2"); > +#endif > -- Florian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-24 0:25 ` Florian Fainelli @ 2017-05-24 0:37 ` Scott Branden 2017-05-24 0:42 ` Florian Fainelli 0 siblings, 1 reply; 26+ messages in thread From: Scott Branden @ 2017-05-24 0:37 UTC (permalink / raw) To: Florian Fainelli, Paul Gortmaker Cc: linux-kernel, Eric Anholt, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel On 17-05-23 05:25 PM, Florian Fainelli wrote: > On 05/23/2017 05:12 PM, Paul Gortmaker wrote: >> [Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions] On 23/05/2017 (Tue 15:15) Scott Branden wrote: >> >>> Hi Paul, >>> >>> Some comments - leave our file headers intact. If you want to add a new >>> comment do so after the existing file header in another comment. But, I >>> don't think any of that information is needed by us. >> OK, no problem, if that is what is desired for your driver. I just >> normally move the author information from the bottom of the file to the >> top of the file. As a lot of the linux driver work was (is?) done for >> kudos and not for career, I can't just delete author information. That >> would not be fair to most of those contributors. >> >> It hasn't been a problem before in all of the other similar commits I've >> made, but I can imagine a tool that does a check on the comment block on >> the top of a file and complains if it changes, or similar. >> >> Would you prefer something like this instead? It leaves your header >> completely untouched, and still gives credit to the original author, >> and those lines are also untouched. > This looks horrible, sorry. Scott, what's the matter with moving the > authors listed in MODULE_AUTHOR() into the header? We have tools for scanning headers. Mucking with the headers is not desirable as tools may need to change. Just place additional comments in new comments blocks. > > If it was up to me, I would just remove the MODULE_* parts and if I need > to look up the author, git log is my friend. > >> I've not re-done build coverage on this yet, but let me know if this is >> what you'd prefer. >> >> Thanks, >> Paul >> -- >> >> From 3f8bf38bcdbf38484182222965aac2748cc1d5cd Mon Sep 17 00:00:00 2001 >> From: Paul Gortmaker <paul.gortmaker@windriver.com> >> Date: Mon, 31 Aug 2015 17:35:47 -0400 >> Subject: [PATCH] pinctrl: bcm: clean up modular vs. non-modular distinctions >> >> Fixups here tend to be more of a conglomerate of some of the other >> repeated/systematic ones we've seen in the earlier pinctrl cleanups. >> >> We remove module.h from code that isn't doing anything modular at >> all; if they have __init sections, then replace it with init.h >> >> One driver has a .remove that would be dispatched on module_exit, >> and as that code is essentially orphaned, so we remove it. In case >> anyone was previously doing the (pointless) unbind to get to that >> function, we disable unbind for this one driver as well. >> >> A couple bool drivers (hence non-modular) are converted over to >> to builtin_platform_driver(). >> >> Since module_platform_driver() uses the same init level priority as >> builtin_platform_driver() the init ordering remains unchanged with >> this commit. >> >> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. >> >> We leave the MODULE_AUTHOR and MODULE_LICENSE tag etc. at the bottom >> of the file since Broadcom would prefer the comment block at the top >> of the file remain unchanged. We just use CPP to take it out of the >> picture with an #if 0 / #endif instead. >> >> Cc: Eric Anholt <eric@anholt.net> >> Cc: Florian Fainelli <f.fainelli@gmail.com> >> Cc: Jon Mason <jonmason@broadcom.com> >> Cc: Linus Walleij <linus.walleij@linaro.org> >> Cc: Ray Jui <rjui@broadcom.com> >> Cc: Scott Branden <sbranden@broadcom.com> >> Cc: Stefan Wahren <stefan.wahren@i2se.com> >> Cc: Sherman Yin <syin@broadcom.com> >> Cc: bcm-kernel-feedback-list@broadcom.com >> Cc: linux-gpio@vger.kernel.org >> Cc: linux-rpi-kernel@lists.infradead.org >> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> >> --- >> drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 7 ++++--- >> drivers/pinctrl/bcm/pinctrl-bcm2835.c | 18 +++++------------- >> drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 3 ++- >> 3 files changed, 11 insertions(+), 17 deletions(-) >> >> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c >> index 810a81786f62..cc01acc988d0 100644 >> --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c >> +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c >> @@ -12,7 +12,7 @@ >> */ >> #include <linux/err.h> >> #include <linux/io.h> >> -#include <linux/module.h> >> +#include <linux/init.h> >> #include <linux/of.h> >> #include <linux/platform_device.h> >> #include <linux/pinctrl/pinctrl.h> >> @@ -1444,10 +1444,11 @@ static struct platform_driver bcm281xx_pinctrl_driver = { >> .of_match_table = bcm281xx_pinctrl_of_match, >> }, >> }; >> +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); >> >> -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); >> - >> +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ >> MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); >> MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); >> MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); >> MODULE_LICENSE("GPL v2"); >> +#endif >> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c >> index 85d009112864..3924ff17e955 100644 >> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c >> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c >> @@ -27,7 +27,7 @@ >> #include <linux/io.h> >> #include <linux/irq.h> >> #include <linux/irqdesc.h> >> -#include <linux/module.h> >> +#include <linux/init.h> >> #include <linux/of_address.h> >> #include <linux/of.h> >> #include <linux/of_irq.h> >> @@ -1075,31 +1075,23 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) >> return 0; >> } >> >> -static int bcm2835_pinctrl_remove(struct platform_device *pdev) >> -{ >> - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); >> - >> - gpiochip_remove(&pc->gpio_chip); >> - >> - return 0; >> -} >> - >> static const struct of_device_id bcm2835_pinctrl_match[] = { >> { .compatible = "brcm,bcm2835-gpio" }, >> {} >> }; >> -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); >> >> static struct platform_driver bcm2835_pinctrl_driver = { >> .probe = bcm2835_pinctrl_probe, >> - .remove = bcm2835_pinctrl_remove, >> .driver = { >> .name = MODULE_NAME, >> .of_match_table = bcm2835_pinctrl_match, >> + .suppress_bind_attrs = true, >> }, >> }; >> -module_platform_driver(bcm2835_pinctrl_driver); >> +builtin_platform_driver(bcm2835_pinctrl_driver); >> >> +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ >> MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); >> MODULE_DESCRIPTION("BCM2835 Pin control driver"); >> MODULE_LICENSE("GPL"); >> +#endif >> diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c >> index d31c95701a92..84c2a182a5b7 100644 >> --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c >> +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c >> @@ -17,7 +17,6 @@ >> >> #include <linux/err.h> >> #include <linux/io.h> >> -#include <linux/module.h> >> #include <linux/of.h> >> #include <linux/slab.h> >> #include <linux/platform_device.h> >> @@ -1017,6 +1016,8 @@ static int __init cygnus_pinmux_init(void) >> } >> arch_initcall(cygnus_pinmux_init); >> >> +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ >> MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); >> MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); >> MODULE_LICENSE("GPL v2"); >> +#endif >> > ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-24 0:37 ` Scott Branden @ 2017-05-24 0:42 ` Florian Fainelli 0 siblings, 0 replies; 26+ messages in thread From: Florian Fainelli @ 2017-05-24 0:42 UTC (permalink / raw) To: Scott Branden, Florian Fainelli, Paul Gortmaker Cc: linux-kernel, Eric Anholt, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel On 05/23/2017 05:37 PM, Scott Branden wrote: > > > On 17-05-23 05:25 PM, Florian Fainelli wrote: >> On 05/23/2017 05:12 PM, Paul Gortmaker wrote: >>> [Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular >>> distinctions] On 23/05/2017 (Tue 15:15) Scott Branden wrote: >>> >>>> Hi Paul, >>>> >>>> Some comments - leave our file headers intact. If you want to add a >>>> new >>>> comment do so after the existing file header in another comment. >>>> But, I >>>> don't think any of that information is needed by us. >>> OK, no problem, if that is what is desired for your driver. I just >>> normally move the author information from the bottom of the file to the >>> top of the file. As a lot of the linux driver work was (is?) done for >>> kudos and not for career, I can't just delete author information. That >>> would not be fair to most of those contributors. >>> >>> It hasn't been a problem before in all of the other similar commits I've >>> made, but I can imagine a tool that does a check on the comment block on >>> the top of a file and complains if it changes, or similar. >>> >>> Would you prefer something like this instead? It leaves your header >>> completely untouched, and still gives credit to the original author, >>> and those lines are also untouched. >> This looks horrible, sorry. Scott, what's the matter with moving the >> authors listed in MODULE_AUTHOR() into the header? > We have tools for scanning headers. Mucking with the headers > is not desirable as tools may need to change. Just place additional > comments in new comments blocks. That's a pretty moot explanation. These tools will have to deal with random changes being done to the kernel as the project keeps seeing more changes. Plus, you may get Paul to do what you him to do here and not put anything in the header, but there is no guarantee someone else won't be doing it, and even if you are CC'd on the patches, what if you are not, and what if you can't defend this "breaks our tools" position, does not scale to me. If it's an internal tool, it can certainly be fixed, if it's coming from an external vendor, I'd be seriously concerned if their scanning/logic started to break in 4.13 because Paul's patches got included... At any rate, I'd just drop the MODULE_AUTHOR() altogether, we can use the SCM to tell us who did what exactly in a much more powerful way (like line by line). -- Florian ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-24 0:12 ` Paul Gortmaker (?) (?) @ 2017-05-24 0:34 ` Scott Branden -1 siblings, 0 replies; 26+ messages in thread From: Scott Branden @ 2017-05-24 0:34 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel, Eric Anholt, Florian Fainelli, Jon Mason, Linus Walleij, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel Hi Paul, On 17-05-23 05:12 PM, Paul Gortmaker wrote: > [Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions] On 23/05/2017 (Tue 15:15) Scott Branden wrote: > >> Hi Paul, >> >> Some comments - leave our file headers intact. If you want to add a new >> comment do so after the existing file header in another comment. But, I >> don't think any of that information is needed by us. > OK, no problem, if that is what is desired for your driver. I just > normally move the author information from the bottom of the file to the > top of the file. As a lot of the linux driver work was (is?) done for > kudos and not for career, I can't just delete author information. That > would not be fair to most of those contributors. > > It hasn't been a problem before in all of the other similar commits I've > made, but I can imagine a tool that does a check on the comment block on > the top of a file and complains if it changes, or similar. > > Would you prefer something like this instead? It leaves your header > completely untouched, and still gives credit to the original author, > and those lines are also untouched. I don't think you should add #if 0 in the code either. Otherwise a search for stale code in #if 0's will have these searches come up. How about just a regular style comment giving kudos to the author if you so desire. Just move your original comment into a new comment block after the header. > > I've not re-done build coverage on this yet, but let me know if this is > what you'd prefer. > > Thanks, > Paul > -- > > From 3f8bf38bcdbf38484182222965aac2748cc1d5cd Mon Sep 17 00:00:00 2001 > From: Paul Gortmaker <paul.gortmaker@windriver.com> > Date: Mon, 31 Aug 2015 17:35:47 -0400 > Subject: [PATCH] pinctrl: bcm: clean up modular vs. non-modular distinctions > > Fixups here tend to be more of a conglomerate of some of the other > repeated/systematic ones we've seen in the earlier pinctrl cleanups. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h > > One driver has a .remove that would be dispatched on module_exit, > and as that code is essentially orphaned, so we remove it. In case > anyone was previously doing the (pointless) unbind to get to that > function, we disable unbind for this one driver as well. > > A couple bool drivers (hence non-modular) are converted over to > to builtin_platform_driver(). > > Since module_platform_driver() uses the same init level priority as > builtin_platform_driver() the init ordering remains unchanged with > this commit. > > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. > > We leave the MODULE_AUTHOR and MODULE_LICENSE tag etc. at the bottom > of the file since Broadcom would prefer the comment block at the top > of the file remain unchanged. We just use CPP to take it out of the > picture with an #if 0 / #endif instead. > > Cc: Eric Anholt <eric@anholt.net> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Jon Mason <jonmason@broadcom.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Ray Jui <rjui@broadcom.com> > Cc: Scott Branden <sbranden@broadcom.com> > Cc: Stefan Wahren <stefan.wahren@i2se.com> > Cc: Sherman Yin <syin@broadcom.com> > Cc: bcm-kernel-feedback-list@broadcom.com > Cc: linux-gpio@vger.kernel.org > Cc: linux-rpi-kernel@lists.infradead.org > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > --- > drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 7 ++++--- > drivers/pinctrl/bcm/pinctrl-bcm2835.c | 18 +++++------------- > drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 3 ++- > 3 files changed, 11 insertions(+), 17 deletions(-) > > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > index 810a81786f62..cc01acc988d0 100644 > --- a/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > +++ b/drivers/pinctrl/bcm/pinctrl-bcm281xx.c > @@ -12,7 +12,7 @@ > */ > #include <linux/err.h> > #include <linux/io.h> > -#include <linux/module.h> > +#include <linux/init.h> > #include <linux/of.h> > #include <linux/platform_device.h> > #include <linux/pinctrl/pinctrl.h> > @@ -1444,10 +1444,11 @@ static struct platform_driver bcm281xx_pinctrl_driver = { > .of_match_table = bcm281xx_pinctrl_of_match, > }, > }; > +builtin_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); > > -module_platform_driver_probe(bcm281xx_pinctrl_driver, bcm281xx_pinctrl_probe); > - > +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ > MODULE_AUTHOR("Broadcom Corporation <bcm-kernel-feedback-list@broadcom.com>"); > MODULE_AUTHOR("Sherman Yin <syin@broadcom.com>"); > MODULE_DESCRIPTION("Broadcom BCM281xx pinctrl driver"); > MODULE_LICENSE("GPL v2"); > +#endif > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > index 85d009112864..3924ff17e955 100644 > --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c > +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > @@ -27,7 +27,7 @@ > #include <linux/io.h> > #include <linux/irq.h> > #include <linux/irqdesc.h> > -#include <linux/module.h> > +#include <linux/init.h> > #include <linux/of_address.h> > #include <linux/of.h> > #include <linux/of_irq.h> > @@ -1075,31 +1075,23 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) > return 0; > } > > -static int bcm2835_pinctrl_remove(struct platform_device *pdev) > -{ > - struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev); > - > - gpiochip_remove(&pc->gpio_chip); > - > - return 0; > -} > - > static const struct of_device_id bcm2835_pinctrl_match[] = { > { .compatible = "brcm,bcm2835-gpio" }, > {} > }; > -MODULE_DEVICE_TABLE(of, bcm2835_pinctrl_match); > > static struct platform_driver bcm2835_pinctrl_driver = { > .probe = bcm2835_pinctrl_probe, > - .remove = bcm2835_pinctrl_remove, > .driver = { > .name = MODULE_NAME, > .of_match_table = bcm2835_pinctrl_match, > + .suppress_bind_attrs = true, > }, > }; > -module_platform_driver(bcm2835_pinctrl_driver); > +builtin_platform_driver(bcm2835_pinctrl_driver); > > +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ > MODULE_AUTHOR("Chris Boot, Simon Arlott, Stephen Warren"); > MODULE_DESCRIPTION("BCM2835 Pin control driver"); > MODULE_LICENSE("GPL"); > +#endif > diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > index d31c95701a92..84c2a182a5b7 100644 > --- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c > @@ -17,7 +17,6 @@ > > #include <linux/err.h> > #include <linux/io.h> > -#include <linux/module.h> > #include <linux/of.h> > #include <linux/slab.h> > #include <linux/platform_device.h> > @@ -1017,6 +1016,8 @@ static int __init cygnus_pinmux_init(void) > } > arch_initcall(cygnus_pinmux_init); > > +#if 0 /* ...def MODULE ; never supported as such; kept for documentation. */ > MODULE_AUTHOR("Ray Jui <rjui@broadcom.com>"); > MODULE_DESCRIPTION("Broadcom Cygnus IOMUX driver"); > MODULE_LICENSE("GPL v2"); > +#endif ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker ` (2 preceding siblings ...) (?) @ 2017-05-29 8:31 ` Linus Walleij 2017-05-29 16:35 ` Scott Branden -1 siblings, 1 reply; 26+ messages in thread From: Linus Walleij @ 2017-05-29 8:31 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel, Eric Anholt, Florian Fainelli, Jon Mason, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker <paul.gortmaker@windriver.com> wrote: > Fixups here tend to be more of a conglomerate of some of the other > repeated/systematic ones we've seen in the earlier pinctrl cleanups. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h > > One driver has a .remove that would be dispatched on module_exit, > and as that code is essentially orphaned, so we remove it. In case > anyone was previously doing the (pointless) unbind to get to that > function, we disable unbind for this one driver as well. > > A couple bool drivers (hence non-modular) are converted over to > to builtin_platform_driver(). > > Since module_platform_driver() uses the same init level priority as > builtin_platform_driver() the init ordering remains unchanged with > this commit. > > 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 > was (or is now) contained at the top of the file in the comments. > > Cc: Eric Anholt <eric@anholt.net> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Jon Mason <jonmason@broadcom.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Ray Jui <rjui@broadcom.com> > Cc: Scott Branden <sbranden@broadcom.com> > Cc: Stefan Wahren <stefan.wahren@i2se.com> > Cc: Sherman Yin <syin@broadcom.com> > Cc: bcm-kernel-feedback-list@broadcom.com > Cc: linux-gpio@vger.kernel.org > Cc: linux-rpi-kernel@lists.infradead.org > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Patch applied with Stefan Wahren's Tested-by tag. I can't take header standardization into account, header files are not ABI, further see Documentation/process/stable-api-nonsense.rst Yours, Linus Walleij ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-29 8:31 ` Linus Walleij @ 2017-05-29 16:35 ` Scott Branden 2017-05-30 7:41 ` Linus Walleij 0 siblings, 1 reply; 26+ messages in thread From: Scott Branden @ 2017-05-29 16:35 UTC (permalink / raw) To: Linus Walleij, Paul Gortmaker Cc: linux-kernel, Eric Anholt, Florian Fainelli, Jon Mason, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel Hi Linus, On 17-05-29 01:31 AM, Linus Walleij wrote: > On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker > <paul.gortmaker@windriver.com> wrote: > >> Fixups here tend to be more of a conglomerate of some of the other >> repeated/systematic ones we've seen in the earlier pinctrl cleanups. >> >> We remove module.h from code that isn't doing anything modular at >> all; if they have __init sections, then replace it with init.h >> >> One driver has a .remove that would be dispatched on module_exit, >> and as that code is essentially orphaned, so we remove it. In case >> anyone was previously doing the (pointless) unbind to get to that >> function, we disable unbind for this one driver as well. >> >> A couple bool drivers (hence non-modular) are converted over to >> to builtin_platform_driver(). >> >> Since module_platform_driver() uses the same init level priority as >> builtin_platform_driver() the init ordering remains unchanged with >> this commit. >> >> 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 >> was (or is now) contained at the top of the file in the comments. >> >> Cc: Eric Anholt <eric@anholt.net> >> Cc: Florian Fainelli <f.fainelli@gmail.com> >> Cc: Jon Mason <jonmason@broadcom.com> >> Cc: Linus Walleij <linus.walleij@linaro.org> >> Cc: Ray Jui <rjui@broadcom.com> >> Cc: Scott Branden <sbranden@broadcom.com> >> Cc: Stefan Wahren <stefan.wahren@i2se.com> >> Cc: Sherman Yin <syin@broadcom.com> >> Cc: bcm-kernel-feedback-list@broadcom.com >> Cc: linux-gpio@vger.kernel.org >> Cc: linux-rpi-kernel@lists.infradead.org >> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > Patch applied with Stefan Wahren's Tested-by tag. > > I can't take header standardization into account, header files are not > ABI, further see > Documentation/process/stable-api-nonsense.rst It is a simple ask to place the new information in a new comment after the legal header. An aim at consistency helps reduce confusion (internal and external) of what license header template to apply to files. Modifying these headers and placing information in the middle of them does not help in this effort. > Yours, > Linus Walleij Regards, Scott ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 3/3] pinctrl: bcm: clean up modular vs. non-modular distinctions 2017-05-29 16:35 ` Scott Branden @ 2017-05-30 7:41 ` Linus Walleij 0 siblings, 0 replies; 26+ messages in thread From: Linus Walleij @ 2017-05-30 7:41 UTC (permalink / raw) To: Scott Branden Cc: Paul Gortmaker, linux-kernel, Eric Anholt, Florian Fainelli, Jon Mason, Ray Jui, Scott Branden, Stefan Wahren, Sherman Yin, bcm-kernel-feedback-list, linux-gpio, linux-rpi-kernel On Mon, May 29, 2017 at 6:35 PM, Scott Branden <scott.branden@broadcom.com> wrote: > It is a simple ask to place the new information in a new comment after the > legal header. OK send a patch fixing the headers the way you want them. I don't mind if you want a certain order on your desk as a figure of speak, I am the same. > An aim at consistency helps reduce confusion (internal and external) > of what license header template to apply to files. Modifying these headers > and placing > information in the middle of them does not help in this effort. Aha, I understand it if a human is reading the files. If it is a machine, not so much, as we should not serve the machines but the other way around. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <20170522205648.23545-1-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>]
* [PATCH 2/3] pinctrl: tegra: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker @ 2017-05-22 20:56 ` Paul Gortmaker -1 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel-u79uwXL29TY76Z2rM5mHXA Cc: Paul Gortmaker, Linus Walleij, Stephen Warren, Thierry Reding, Alexandre Courbot, Pritesh Raithatha, Ashwini Ghuge, linux-gpio-u79uwXL29TY76Z2rM5mHXA, linux-tegra-u79uwXL29TY76Z2rM5mHXA None of the Kconfigs for any of these drivers are tristate, meaning that they currently are not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the drivers there is no doubt they are builtin-only. All drivers get similar changes, so they are handled in batch. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h. A couple drivers have module_exit() code that is essentially orphaned, and so we remove that. Quite a few bool drivers (hence non-modular) are converted over to to builtin_platform_driver(). Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. 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 was (or is now) contained at the top of the file in the comments. Cc: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: Alexandre Courbot <gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: Pritesh Raithatha <praithatha-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> Cc: Ashwini Ghuge <aghuge-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Signed-off-by: Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> --- drivers/pinctrl/tegra/pinctrl-tegra.c | 1 - drivers/pinctrl/tegra/pinctrl-tegra114.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra124.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra20.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra210.c | 9 ++------- drivers/pinctrl/tegra/pinctrl-tegra30.c | 11 ++++------- 6 files changed, 18 insertions(+), 36 deletions(-) diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c index 277622b4b6fb..51716819129d 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c @@ -21,7 +21,6 @@ #include <linux/err.h> #include <linux/init.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/machine.h> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra114.c b/drivers/pinctrl/tegra/pinctrl-tegra114.c index 952132ce5ea0..56b33fca1bfc 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra114.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra114.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra114 pinmux * + * Author: Pritesh Raithatha <praithatha-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> + * * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -13,7 +15,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1857,7 +1859,6 @@ static const struct of_device_id tegra114_pinctrl_of_match[] = { { .compatible = "nvidia,tegra114-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra114_pinctrl_of_match); static struct platform_driver tegra114_pinctrl_driver = { .driver = { @@ -1866,8 +1867,4 @@ static struct platform_driver tegra114_pinctrl_driver = { }, .probe = tegra114_pinctrl_probe, }; -module_platform_driver(tegra114_pinctrl_driver); - -MODULE_AUTHOR("Pritesh Raithatha <praithatha-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>"); -MODULE_DESCRIPTION("NVIDIA Tegra114 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra114_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra124.c b/drivers/pinctrl/tegra/pinctrl-tegra124.c index bca239e3ae50..7bc998ace0d5 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra124.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra124.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra124 pinmux * + * Author: Ashwini Ghuge <aghuge-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> + * * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -13,7 +15,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -2069,7 +2071,6 @@ static const struct of_device_id tegra124_pinctrl_of_match[] = { { .compatible = "nvidia,tegra124-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra124_pinctrl_of_match); static struct platform_driver tegra124_pinctrl_driver = { .driver = { @@ -2078,8 +2079,4 @@ static struct platform_driver tegra124_pinctrl_driver = { }, .probe = tegra124_pinctrl_probe, }; -module_platform_driver(tegra124_pinctrl_driver); - -MODULE_AUTHOR("Ashwini Ghuge <aghuge-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>"); -MODULE_DESCRIPTION("NVIDIA Tegra124 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra124_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra20.c b/drivers/pinctrl/tegra/pinctrl-tegra20.c index ad62451a5a9b..7e38ee9bae78 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra20.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra20.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra20 pinmux * + * Author: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> + * * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. * * Derived from code: @@ -17,7 +19,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -2246,9 +2248,4 @@ static struct platform_driver tegra20_pinctrl_driver = { }, .probe = tegra20_pinctrl_probe, }; -module_platform_driver(tegra20_pinctrl_driver); - -MODULE_AUTHOR("Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>"); -MODULE_DESCRIPTION("NVIDIA Tegra20 pinctrl driver"); -MODULE_LICENSE("GPL v2"); -MODULE_DEVICE_TABLE(of, tegra20_pinctrl_of_match); +builtin_platform_driver(tegra20_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra210.c b/drivers/pinctrl/tegra/pinctrl-tegra210.c index 2b70e93da9db..c244e5b17bd6 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra210.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra210.c @@ -13,7 +13,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1573,7 +1573,6 @@ static const struct of_device_id tegra210_pinctrl_of_match[] = { { .compatible = "nvidia,tegra210-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra210_pinctrl_of_match); static struct platform_driver tegra210_pinctrl_driver = { .driver = { @@ -1582,8 +1581,4 @@ static struct platform_driver tegra210_pinctrl_driver = { }, .probe = tegra210_pinctrl_probe, }; -module_platform_driver(tegra210_pinctrl_driver); - -MODULE_AUTHOR("NVIDIA"); -MODULE_DESCRIPTION("NVIDIA Tegra210 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra210_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra30.c b/drivers/pinctrl/tegra/pinctrl-tegra30.c index 474ac6daf513..1f180a20f2ab 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra30.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra30.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra30 pinmux * + * Author: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> + * * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -13,7 +15,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -2492,7 +2494,6 @@ static const struct of_device_id tegra30_pinctrl_of_match[] = { { .compatible = "nvidia,tegra30-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra30_pinctrl_of_match); static struct platform_driver tegra30_pinctrl_driver = { .driver = { @@ -2501,8 +2502,4 @@ static struct platform_driver tegra30_pinctrl_driver = { }, .probe = tegra30_pinctrl_probe, }; -module_platform_driver(tegra30_pinctrl_driver); - -MODULE_AUTHOR("Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>"); -MODULE_DESCRIPTION("NVIDIA Tegra30 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra30_pinctrl_driver); -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 2/3] pinctrl: tegra: clean up modular vs. non-modular distinctions @ 2017-05-22 20:56 ` Paul Gortmaker 0 siblings, 0 replies; 26+ messages in thread From: Paul Gortmaker @ 2017-05-22 20:56 UTC (permalink / raw) To: linux-kernel Cc: Paul Gortmaker, Linus Walleij, Stephen Warren, Thierry Reding, Alexandre Courbot, Pritesh Raithatha, Ashwini Ghuge, linux-gpio, linux-tegra None of the Kconfigs for any of these drivers are tristate, meaning that they currently are not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the drivers there is no doubt they are builtin-only. All drivers get similar changes, so they are handled in batch. We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h. A couple drivers have module_exit() code that is essentially orphaned, and so we remove that. Quite a few bool drivers (hence non-modular) are converted over to to builtin_platform_driver(). Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. 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 was (or is now) contained at the top of the file in the comments. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Pritesh Raithatha <praithatha@nvidia.com> Cc: Ashwini Ghuge <aghuge@nvidia.com> Cc: linux-gpio@vger.kernel.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- drivers/pinctrl/tegra/pinctrl-tegra.c | 1 - drivers/pinctrl/tegra/pinctrl-tegra114.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra124.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra20.c | 11 ++++------- drivers/pinctrl/tegra/pinctrl-tegra210.c | 9 ++------- drivers/pinctrl/tegra/pinctrl-tegra30.c | 11 ++++------- 6 files changed, 18 insertions(+), 36 deletions(-) diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c index 277622b4b6fb..51716819129d 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c @@ -21,7 +21,6 @@ #include <linux/err.h> #include <linux/init.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/machine.h> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra114.c b/drivers/pinctrl/tegra/pinctrl-tegra114.c index 952132ce5ea0..56b33fca1bfc 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra114.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra114.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra114 pinmux * + * Author: Pritesh Raithatha <praithatha@nvidia.com> + * * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -13,7 +15,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1857,7 +1859,6 @@ static const struct of_device_id tegra114_pinctrl_of_match[] = { { .compatible = "nvidia,tegra114-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra114_pinctrl_of_match); static struct platform_driver tegra114_pinctrl_driver = { .driver = { @@ -1866,8 +1867,4 @@ static struct platform_driver tegra114_pinctrl_driver = { }, .probe = tegra114_pinctrl_probe, }; -module_platform_driver(tegra114_pinctrl_driver); - -MODULE_AUTHOR("Pritesh Raithatha <praithatha@nvidia.com>"); -MODULE_DESCRIPTION("NVIDIA Tegra114 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra114_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra124.c b/drivers/pinctrl/tegra/pinctrl-tegra124.c index bca239e3ae50..7bc998ace0d5 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra124.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra124.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra124 pinmux * + * Author: Ashwini Ghuge <aghuge@nvidia.com> + * * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -13,7 +15,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -2069,7 +2071,6 @@ static const struct of_device_id tegra124_pinctrl_of_match[] = { { .compatible = "nvidia,tegra124-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra124_pinctrl_of_match); static struct platform_driver tegra124_pinctrl_driver = { .driver = { @@ -2078,8 +2079,4 @@ static struct platform_driver tegra124_pinctrl_driver = { }, .probe = tegra124_pinctrl_probe, }; -module_platform_driver(tegra124_pinctrl_driver); - -MODULE_AUTHOR("Ashwini Ghuge <aghuge@nvidia.com>"); -MODULE_DESCRIPTION("NVIDIA Tegra124 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra124_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra20.c b/drivers/pinctrl/tegra/pinctrl-tegra20.c index ad62451a5a9b..7e38ee9bae78 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra20.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra20.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra20 pinmux * + * Author: Stephen Warren <swarren@nvidia.com> + * * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. * * Derived from code: @@ -17,7 +19,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -2246,9 +2248,4 @@ static struct platform_driver tegra20_pinctrl_driver = { }, .probe = tegra20_pinctrl_probe, }; -module_platform_driver(tegra20_pinctrl_driver); - -MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>"); -MODULE_DESCRIPTION("NVIDIA Tegra20 pinctrl driver"); -MODULE_LICENSE("GPL v2"); -MODULE_DEVICE_TABLE(of, tegra20_pinctrl_of_match); +builtin_platform_driver(tegra20_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra210.c b/drivers/pinctrl/tegra/pinctrl-tegra210.c index 2b70e93da9db..c244e5b17bd6 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra210.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra210.c @@ -13,7 +13,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -1573,7 +1573,6 @@ static const struct of_device_id tegra210_pinctrl_of_match[] = { { .compatible = "nvidia,tegra210-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra210_pinctrl_of_match); static struct platform_driver tegra210_pinctrl_driver = { .driver = { @@ -1582,8 +1581,4 @@ static struct platform_driver tegra210_pinctrl_driver = { }, .probe = tegra210_pinctrl_probe, }; -module_platform_driver(tegra210_pinctrl_driver); - -MODULE_AUTHOR("NVIDIA"); -MODULE_DESCRIPTION("NVIDIA Tegra210 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra210_pinctrl_driver); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra30.c b/drivers/pinctrl/tegra/pinctrl-tegra30.c index 474ac6daf513..1f180a20f2ab 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra30.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra30.c @@ -1,6 +1,8 @@ /* * Pinctrl data for the NVIDIA Tegra30 pinmux * + * Author: Stephen Warren <swarren@nvidia.com> + * * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -13,7 +15,7 @@ * more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pinctrl/pinctrl.h> @@ -2492,7 +2494,6 @@ static const struct of_device_id tegra30_pinctrl_of_match[] = { { .compatible = "nvidia,tegra30-pinmux", }, { }, }; -MODULE_DEVICE_TABLE(of, tegra30_pinctrl_of_match); static struct platform_driver tegra30_pinctrl_driver = { .driver = { @@ -2501,8 +2502,4 @@ static struct platform_driver tegra30_pinctrl_driver = { }, .probe = tegra30_pinctrl_probe, }; -module_platform_driver(tegra30_pinctrl_driver); - -MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>"); -MODULE_DESCRIPTION("NVIDIA Tegra30 pinctrl driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(tegra30_pinctrl_driver); -- 2.11.0 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 2/3] pinctrl: tegra: clean up modular vs. non-modular distinctions 2017-05-22 20:56 ` Paul Gortmaker (?) @ 2017-05-29 8:25 ` Linus Walleij -1 siblings, 0 replies; 26+ messages in thread From: Linus Walleij @ 2017-05-29 8:25 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel, Stephen Warren, Thierry Reding, Alexandre Courbot, Pritesh Raithatha, Ashwini Ghuge, linux-gpio, linux-tegra On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker <paul.gortmaker@windriver.com> wrote: > None of the Kconfigs for any of these drivers are tristate, > meaning that they currently are not being built as a module by anyone. > > Lets remove the modular code that is essentially orphaned, so that > when reading the drivers there is no doubt they are builtin-only. All > drivers get similar changes, so they are handled in batch. > > We remove module.h from code that isn't doing anything modular at > all; if they have __init sections, then replace it with init.h. > > A couple drivers have module_exit() code that is essentially orphaned, > and so we remove that. > > Quite a few bool drivers (hence non-modular) are converted over to > to builtin_platform_driver(). > > Since module_platform_driver() uses the same init level priority as > builtin_platform_driver() the init ordering remains unchanged with > this commit. > > 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 > was (or is now) contained at the top of the file in the comments. > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Stephen Warren <swarren@wwwdotorg.org> > Cc: Thierry Reding <thierry.reding@gmail.com> > Cc: Alexandre Courbot <gnurou@gmail.com> > Cc: Pritesh Raithatha <praithatha@nvidia.com> > Cc: Ashwini Ghuge <aghuge@nvidia.com> > Cc: linux-gpio@vger.kernel.org > Cc: linux-tegra@vger.kernel.org > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Patch applied. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 0/3] pinctrl: bcm/samsung/tegra: make bool code non-modular 2017-05-22 20:56 ` Paul Gortmaker @ 2017-05-29 8:33 ` Linus Walleij -1 siblings, 0 replies; 26+ messages in thread From: Linus Walleij @ 2017-05-29 8:33 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Alexandre Courbot, Ashwini Ghuge, bcm-kernel-feedback-list, Eric Anholt, Florian Fainelli, Jon Mason, Pritesh Raithatha, Ray Jui, Scott Branden, Sherman Yin, Stefan Wahren, Stephen Warren, Thierry Reding, Thomas Abraham, Tomasz Figa, linux-gpio-u79uwXL29TY76Z2rM5mHXA, linux-rpi-kernel On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker <paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> wrote: > This is the last of the pinctrl cleanups I have in my queue. Awesome. > Linus - thanks for your patience in merging all these to date. You are the patient one. I'm just merging... I was sold on the technical merit if these patches once it was explained to me that #include <linux/module.h> actually has a significant impact on compile time when accumulated across the kernel. This just needs to be done right and you make it so. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 0/3] pinctrl: bcm/samsung/tegra: make bool code non-modular @ 2017-05-29 8:33 ` Linus Walleij 0 siblings, 0 replies; 26+ messages in thread From: Linus Walleij @ 2017-05-29 8:33 UTC (permalink / raw) To: Paul Gortmaker Cc: linux-kernel, Alexandre Courbot, Ashwini Ghuge, bcm-kernel-feedback-list, Eric Anholt, Florian Fainelli, Jon Mason, Pritesh Raithatha, Ray Jui, Scott Branden, Sherman Yin, Stefan Wahren, Stephen Warren, Thierry Reding, Thomas Abraham, Tomasz Figa, linux-gpio, linux-rpi-kernel, linux-samsung-soc, linux-tegra On Mon, May 22, 2017 at 10:56 PM, Paul Gortmaker <paul.gortmaker@windriver.com> wrote: > This is the last of the pinctrl cleanups I have in my queue. Awesome. > Linus - thanks for your patience in merging all these to date. You are the patient one. I'm just merging... I was sold on the technical merit if these patches once it was explained to me that #include <linux/module.h> actually has a significant impact on compile time when accumulated across the kernel. This just needs to be done right and you make it so. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2017-05-30 7:41 UTC | newest] Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-05-22 20:56 [PATCH 0/3] pinctrl: bcm/samsung/tegra: make bool code non-modular Paul Gortmaker 2017-05-22 20:56 ` Paul Gortmaker 2017-05-22 20:56 ` [PATCH 1/3] pinctrl: samsung: clean up modular vs. non-modular distinctions Paul Gortmaker 2017-05-22 20:56 ` Paul Gortmaker 2017-05-23 14:51 ` Krzysztof Kozlowski 2017-05-23 15:54 ` Paul Gortmaker 2017-05-23 15:54 ` Paul Gortmaker 2017-05-29 8:24 ` Linus Walleij 2017-05-22 20:56 ` [PATCH 3/3] pinctrl: bcm: " Paul Gortmaker 2017-05-22 20:56 ` Paul Gortmaker 2017-05-23 20:11 ` Stefan Wahren 2017-05-23 22:15 ` Scott Branden 2017-05-24 0:12 ` Paul Gortmaker 2017-05-24 0:12 ` Paul Gortmaker 2017-05-24 0:25 ` Florian Fainelli 2017-05-24 0:37 ` Scott Branden 2017-05-24 0:42 ` Florian Fainelli 2017-05-24 0:34 ` Scott Branden 2017-05-29 8:31 ` Linus Walleij 2017-05-29 16:35 ` Scott Branden 2017-05-30 7:41 ` Linus Walleij [not found] ` <20170522205648.23545-1-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> 2017-05-22 20:56 ` [PATCH 2/3] pinctrl: tegra: " Paul Gortmaker 2017-05-22 20:56 ` Paul Gortmaker 2017-05-29 8:25 ` Linus Walleij 2017-05-29 8:33 ` [PATCH 0/3] pinctrl: bcm/samsung/tegra: make bool code non-modular Linus Walleij 2017-05-29 8:33 ` Linus Walleij
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.