From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Guanbing Huang <albanhuang@outlook.com>,
Guanbing Huang <albanhuang@tencent.com>,
Christoph Hellwig <hch@infradead.org>
Subject: [PATCH v2 2/2] PNP: Hide pnp_bus_type from the non-PNP code
Date: Tue, 28 May 2024 13:25:03 +0300 [thread overview]
Message-ID: <20240528102708.1451343-3-andy.shevchenko@gmail.com> (raw)
In-Reply-To: <20240528102708.1451343-1-andy.shevchenko@gmail.com>
The pnp_bus_type is defined only when CONFIG_PNP=y, while being
not guarded by ifdeffery in the header. Moreover, it's not used
outside of the PNP code. Move it to the internal header to make
sure no-one will try to (ab)use it.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/pnp/base.h | 1 +
include/linux/pnp.h | 2 --
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h
index e74a0f6a3157..4e80273dfb1e 100644
--- a/drivers/pnp/base.h
+++ b/drivers/pnp/base.h
@@ -6,6 +6,7 @@
extern struct mutex pnp_lock;
extern const struct attribute_group *pnp_dev_groups[];
+extern const struct bus_type pnp_bus_type;
int pnp_register_protocol(struct pnp_protocol *protocol);
void pnp_unregister_protocol(struct pnp_protocol *protocol);
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index a8def1cea32c..7f2ff95d2deb 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -435,8 +435,6 @@ struct pnp_protocol {
#define protocol_for_each_dev(protocol, dev) \
list_for_each_entry(dev, &(protocol)->devices, protocol_list)
-extern const struct bus_type pnp_bus_type;
-
#if defined(CONFIG_PNP)
/* device management */
--
2.45.1
next prev parent reply other threads:[~2024-05-28 10:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 10:25 [PATCH v2 0/2] PNP: Fix handling of pnp_bus_type Andy Shevchenko
2024-05-28 10:25 ` [PATCH v2 1/2] PNP: Make dev_is_pnp() to be a function and export it for modules Andy Shevchenko
2024-05-28 10:53 ` Christoph Hellwig
2024-05-28 19:55 ` Rafael J. Wysocki
2024-05-28 10:25 ` Andy Shevchenko [this message]
2024-05-28 10:53 ` [PATCH v2 2/2] PNP: Hide pnp_bus_type from the non-PNP code Christoph Hellwig
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=20240528102708.1451343-3-andy.shevchenko@gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=albanhuang@outlook.com \
--cc=albanhuang@tencent.com \
--cc=hch@infradead.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.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