pwm: lpss: Move exported symbols to PWM_LPSS namespace
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 27 Sep 2022 16:24:16 +0000 (19:24 +0300)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 28 Sep 2022 14:08:51 +0000 (16:08 +0200)
Avoid unnecessary pollution of the global symbol namespace by
moving library functions in to a specific namespace and import
that into the drivers that make use of the functions.

For more info: https://lwn.net/Articles/760045/

Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpss-pci.c
drivers/pwm/pwm-lpss-platform.c
drivers/pwm/pwm-lpss.c

index 75b778e839b3dfd2ccdcacb2d672c737306ec71f..9f2c666b95ecde14412b683c2c80a0c05de1939e 100644 (file)
@@ -92,3 +92,4 @@ module_pci_driver(pwm_lpss_driver_pci);
 
 MODULE_DESCRIPTION("PWM PCI driver for Intel LPSS");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(PWM_LPSS);
index 834423c34f4817e33962074c83ced30e6fabdc69..65154c0abab1b35796de91aeb3293074b83c3bf1 100644 (file)
@@ -88,4 +88,5 @@ module_platform_driver(pwm_lpss_driver_platform);
 
 MODULE_DESCRIPTION("PWM platform driver for Intel LPSS");
 MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(PWM_LPSS);
 MODULE_ALIAS("platform:pwm-lpss");
index 9537aefd254a06b584c1f503262f0c04b69e19b7..74a296cb1af014c9a5a031900d17aba4f3c9c81b 100644 (file)
@@ -18,6 +18,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/time.h>
 
+#define DEFAULT_SYMBOL_NAMESPACE PWM_LPSS
+
 #include "pwm-lpss.h"
 
 #define PWM                            0x00000000