Linux PWM subsystem development
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: linux-pwm@vger.kernel.org
Cc: "Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	platform-driver-x86@vger.kernel.org
Subject: [PATCH 1/2] pwm: lpss: Move namespace import into a header
Date: Tue,  3 Dec 2024 18:16:14 +0100	[thread overview]
Message-ID: <3a99048a52aeee356d01dbf7f2f06e6e0826ed78.1733245406.git.ukleinek@kernel.org> (raw)
In-Reply-To: <cover.1733245406.git.ukleinek@kernel.org>

Each user of the exported symbols related to the pwm-lpss driver needs
to import the matching namespace. So this can just be done in the header
together with the prototypes.

This fixes drivers/pinctrl/intel/pinctrl-intel.c which failed to import
that namespace before. (However this didn't hurt because the pwm-lpss
module namespace isn't used; see the next commit.)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
 drivers/pwm/pwm-lpss-pci.c                 | 2 --
 drivers/pwm/pwm-lpss-platform.c            | 2 --
 include/linux/platform_data/x86/pwm-lpss.h | 7 +++++++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/pwm/pwm-lpss-pci.c b/drivers/pwm/pwm-lpss-pci.c
index f7ece2809e6b..8615c44c1034 100644
--- a/drivers/pwm/pwm-lpss-pci.c
+++ b/drivers/pwm/pwm-lpss-pci.c
@@ -8,7 +8,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 
@@ -70,4 +69,3 @@ module_pci_driver(pwm_lpss_driver_pci);
 
 MODULE_DESCRIPTION("PWM PCI driver for Intel LPSS");
 MODULE_LICENSE("GPL v2");
-MODULE_IMPORT_NS(PWM_LPSS);
diff --git a/drivers/pwm/pwm-lpss-platform.c b/drivers/pwm/pwm-lpss-platform.c
index 5130238a4567..3de1ab2cff54 100644
--- a/drivers/pwm/pwm-lpss-platform.c
+++ b/drivers/pwm/pwm-lpss-platform.c
@@ -9,7 +9,6 @@
 
 #include <linux/kernel.h>
 #include <linux/mod_devicetable.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/property.h>
@@ -78,5 +77,4 @@ 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");
diff --git a/include/linux/platform_data/x86/pwm-lpss.h b/include/linux/platform_data/x86/pwm-lpss.h
index 752c06b47cc8..0a1025f6cd58 100644
--- a/include/linux/platform_data/x86/pwm-lpss.h
+++ b/include/linux/platform_data/x86/pwm-lpss.h
@@ -4,6 +4,7 @@
 #ifndef __PLATFORM_DATA_X86_PWM_LPSS_H
 #define __PLATFORM_DATA_X86_PWM_LPSS_H
 
+#include <linux/module.h>
 #include <linux/types.h>
 
 struct device;
@@ -30,4 +31,10 @@ struct pwm_lpss_boardinfo {
 struct pwm_chip *devm_pwm_lpss_probe(struct device *dev, void __iomem *base,
 				     const struct pwm_lpss_boardinfo *info);
 
+/*
+ * The above function and the pwm_lpss_boardinfo variables in
+ * drivers/pwm/pwm-lpss.h are defined in the PWM_LPSS namespace.
+ */
+MODULE_IMPORT_NS(PWM_LPSS);
+
 #endif	/* __PLATFORM_DATA_X86_PWM_LPSS_H */
-- 
2.45.2


  reply	other threads:[~2024-12-03 17:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 17:16 [PATCH 0/2] pwm: lpss: module namespace fixes Uwe Kleine-König
2024-12-03 17:16 ` Uwe Kleine-König [this message]
2024-12-03 19:12   ` [PATCH 1/2] pwm: lpss: Move namespace import into a header Andy Shevchenko
2024-12-03 21:32     ` Uwe Kleine-König
2024-12-03 22:28       ` Andy Shevchenko
2024-12-03 23:38         ` Uwe Kleine-König
2024-12-04  1:50           ` Andy Shevchenko
2024-12-16  8:46     ` Uwe Kleine-König
2025-01-21 22:46       ` Linus Walleij
2024-12-03 17:16 ` [PATCH 2/2] pwm: lpss: Define DEFAULT_SYMBOL_NAMESPACE earlier Uwe Kleine-König
2024-12-03 19:19   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a99048a52aeee356d01dbf7f2f06e6e0826ed78.1733245406.git.ukleinek@kernel.org \
    --to=u.kleine-koenig@baylibre.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox