* [PATCH] PNP: make pnp_bus_type const
@ 2024-01-05 12:51 Greg Kroah-Hartman
2024-01-09 14:01 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-05 12:51 UTC (permalink / raw)
To: rafael.j.wysocki; +Cc: linux-kernel, Greg Kroah-Hartman, linux-acpi
Now that the driver core can properly handle constant struct bus_type,
move the pnp_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pnp/driver.c | 2 +-
include/linux/pnp.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 46c534f6b1c9..0a5d0d8befa8 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -256,7 +256,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
.restore = pnp_bus_resume,
};
-struct bus_type pnp_bus_type = {
+const struct bus_type pnp_bus_type = {
.name = "pnp",
.match = pnp_bus_match,
.probe = pnp_device_probe,
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 267fb8a4fb6e..ddbe7c3ca4ce 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -435,7 +435,7 @@ struct pnp_protocol {
#define protocol_for_each_dev(protocol, dev) \
list_for_each_entry(dev, &(protocol)->devices, protocol_list)
-extern struct bus_type pnp_bus_type;
+extern const struct bus_type pnp_bus_type;
#if defined(CONFIG_PNP)
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PNP: make pnp_bus_type const
2024-01-05 12:51 [PATCH] PNP: make pnp_bus_type const Greg Kroah-Hartman
@ 2024-01-09 14:01 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2024-01-09 14:01 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: rafael.j.wysocki, linux-kernel, linux-acpi
On Fri, Jan 5, 2024 at 1:51 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> Now that the driver core can properly handle constant struct bus_type,
> move the pnp_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: linux-acpi@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/pnp/driver.c | 2 +-
> include/linux/pnp.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
> index 46c534f6b1c9..0a5d0d8befa8 100644
> --- a/drivers/pnp/driver.c
> +++ b/drivers/pnp/driver.c
> @@ -256,7 +256,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
> .restore = pnp_bus_resume,
> };
>
> -struct bus_type pnp_bus_type = {
> +const struct bus_type pnp_bus_type = {
> .name = "pnp",
> .match = pnp_bus_match,
> .probe = pnp_device_probe,
> diff --git a/include/linux/pnp.h b/include/linux/pnp.h
> index 267fb8a4fb6e..ddbe7c3ca4ce 100644
> --- a/include/linux/pnp.h
> +++ b/include/linux/pnp.h
> @@ -435,7 +435,7 @@ struct pnp_protocol {
> #define protocol_for_each_dev(protocol, dev) \
> list_for_each_entry(dev, &(protocol)->devices, protocol_list)
>
> -extern struct bus_type pnp_bus_type;
> +extern const struct bus_type pnp_bus_type;
>
> #if defined(CONFIG_PNP)
>
> --
Applied as 6.8-rc1 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-09 14:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-05 12:51 [PATCH] PNP: make pnp_bus_type const Greg Kroah-Hartman
2024-01-09 14:01 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).