diff mbox series

[2/3] HID: make ishtp_cl_bus_type const

Message ID 2023122048-tribute-quote-1b4d@gregkh (mailing list archive)
State Mainlined
Commit c4a9743699f3b093bad4bcc472c4ee34c7929f33
Delegated to: Jiri Kosina
Headers show
Series [1/3] HID: make hid_bus_type const | expand

Commit Message

Greg KH Dec. 20, 2023, 7:38 a.m. UTC
Now that the driver core can properly handle constant struct bus_type,
move the ishtp_cl_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

srinivas pandruvada Dec. 20, 2023, 12:55 p.m. UTC | #1
On Wed, 2023-12-20 at 08:38 +0100, Greg Kroah-Hartman wrote:
> Now that the driver core can properly handle constant struct
> bus_type,
> move the ishtp_cl_bus_type variable to be a constant structure as
> well,
> placing it into read-only memory which can not be modified at
> runtime.
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c
> b/drivers/hid/intel-ish-hid/ishtp/bus.c
> index 7fc738a22375..aa6cb033bb06 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/bus.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
> @@ -378,7 +378,7 @@ static const struct dev_pm_ops
> ishtp_cl_bus_dev_pm_ops = {
>         .restore = ishtp_cl_device_resume,
>  };
>  
> -static struct bus_type ishtp_cl_bus_type = {
> +static const struct bus_type ishtp_cl_bus_type = {
>         .name           = "ishtp",
>         .dev_groups     = ishtp_cl_dev_groups,
>         .probe          = ishtp_cl_device_probe,
diff mbox series

Patch

diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index 7fc738a22375..aa6cb033bb06 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -378,7 +378,7 @@  static const struct dev_pm_ops ishtp_cl_bus_dev_pm_ops = {
 	.restore = ishtp_cl_device_resume,
 };
 
-static struct bus_type ishtp_cl_bus_type = {
+static const struct bus_type ishtp_cl_bus_type = {
 	.name		= "ishtp",
 	.dev_groups	= ishtp_cl_dev_groups,
 	.probe		= ishtp_cl_device_probe,