2024-02-03 18:24:49

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH 0/2] drivers: drm: struct bus_type cleanup

This series is part of an effort to cleanup the users of the driver
core, as can be seen in many recent patches authored by Greg across the
tree (e.g. [1]). Specifically, this series is part of the task of
splitting one of his TODOs [2].

---
[1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aa

To: Maarten Lankhorst <[email protected]>
To: Maxime Ripard <[email protected]>
To: Thomas Zimmermann <[email protected]>
To: David Airlie <[email protected]>
To: Daniel Vetter <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>

---
Ricardo B. Marliere (2):
drm: display: make dp_aux_bus_type const
drm: mipi-dsi: make mipi_dsi_bus_type const

drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +-
drivers/gpu/drm/drm_mipi_dsi.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 3d94e7584486f7ac4a44fe215330ae6a1094e492
change-id: 20240203-bus_cleanup-gpu-0f90574bce24

Best regards,
--
Ricardo B. Marliere <[email protected]>



2024-02-03 18:25:02

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH 1/2] drm: display: make dp_aux_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the dp_aux_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <[email protected]>
Suggested-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>
---
drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/display/drm_dp_aux_bus.c b/drivers/gpu/drm/display/drm_dp_aux_bus.c
index 8a165be1a821..5afc26be9d2a 100644
--- a/drivers/gpu/drm/display/drm_dp_aux_bus.c
+++ b/drivers/gpu/drm/display/drm_dp_aux_bus.c
@@ -127,7 +127,7 @@ static void dp_aux_ep_shutdown(struct device *dev)
aux_ep_drv->shutdown(to_dp_aux_ep_dev(dev));
}

-static struct bus_type dp_aux_bus_type = {
+static const struct bus_type dp_aux_bus_type = {
.name = "dp-aux",
.match = dp_aux_ep_match,
.probe = dp_aux_ep_probe,

--
2.43.0


2024-02-03 18:25:16

by Ricardo B. Marliere

[permalink] [raw]
Subject: [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the mipi_dsi_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <[email protected]>
Suggested-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Ricardo B. Marliere <[email protected]>
---
drivers/gpu/drm/drm_mipi_dsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 843a6dbda93a..ef6e416522f8 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -89,7 +89,7 @@ static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
.restore = pm_generic_restore,
};

-static struct bus_type mipi_dsi_bus_type = {
+static const struct bus_type mipi_dsi_bus_type = {
.name = "mipi-dsi",
.match = mipi_dsi_device_match,
.uevent = mipi_dsi_uevent,

--
2.43.0


2024-02-03 18:36:42

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 0/2] drivers: drm: struct bus_type cleanup

On Sat, Feb 03, 2024 at 03:25:02PM -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Specifically, this series is part of the task of
> splitting one of his TODOs [2].
>
> ---
> [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aa
>
> To: Maarten Lankhorst <[email protected]>
> To: Maxime Ripard <[email protected]>
> To: Thomas Zimmermann <[email protected]>
> To: David Airlie <[email protected]>
> To: Daniel Vetter <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: <[email protected]>
> Cc: <[email protected]>
> Signed-off-by: Ricardo B. Marliere <[email protected]>
>
> ---
> Ricardo B. Marliere (2):
> drm: display: make dp_aux_bus_type const
> drm: mipi-dsi: make mipi_dsi_bus_type const
>

Reviewed-by: Greg Kroah-Hartman <[email protected]>

2024-02-04 09:25:07

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 1/2] drm: display: make dp_aux_bus_type const

On Sat, 3 Feb 2024 at 22:20, Ricardo B. Marliere <[email protected]> wrote:
>
> Now that the driver core can properly handle constant struct bus_type,
> move the dp_aux_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Suggested-by: Greg Kroah-Hartman <[email protected]>
> Signed-off-by: Ricardo B. Marliere <[email protected]>

Reviewed-by: Dmitry Baryshkov <[email protected]>

> ---
> drivers/gpu/drm/display/drm_dp_aux_bus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

--
With best wishes
Dmitry

2024-02-04 09:25:41

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const

On Sat, 3 Feb 2024 at 22:20, Ricardo B. Marliere <[email protected]> wrote:
>
> Now that the driver core can properly handle constant struct bus_type,
> move the mipi_dsi_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Suggested-by: Greg Kroah-Hartman <[email protected]>
> Signed-off-by: Ricardo B. Marliere <[email protected]>
> ---
> drivers/gpu/drm/drm_mipi_dsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Dmitry Baryshkov <[email protected]>


--
With best wishes
Dmitry

2024-02-06 15:03:48

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH 1/2] drm: display: make dp_aux_bus_type const

On Sun, Feb 04, 2024 at 10:24:46AM +0100, Dmitry Baryshkov wrote:
> On Sat, 3 Feb 2024 at 22:20, Ricardo B. Marliere <[email protected]> wrote:
> >
> > Now that the driver core can properly handle constant struct bus_type,
> > move the dp_aux_bus_type variable to be a constant structure as well,
> > placing it into read-only memory which can not be modified at runtime.
> >
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Suggested-by: Greg Kroah-Hartman <[email protected]>
> > Signed-off-by: Ricardo B. Marliere <[email protected]>
>
> Reviewed-by: Dmitry Baryshkov <[email protected]>

Just to make sure this doesn't fall through cracks, I'm assuming you'll
push this to drm-misc-next too, right?
-Sima
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

2024-02-07 10:40:17

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 0/2] drivers: drm: struct bus_type cleanup

On Sat, 03 Feb 2024 15:25:02 -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Specifically, this series is part of the task of
> splitting one of his TODOs [2].
>

Applied to drm-misc-next, thanks!

[1/2] drm: display: make dp_aux_bus_type const
commit: 78cb1f1d19b600ed288ed7ad1fd7b9378302cbc5
[2/2] drm: mipi-dsi: make mipi_dsi_bus_type const
commit: 2c8ba564a42c7418a726367c73d7c88454848fdc

Best regards,
--
Dmitry Baryshkov <[email protected]>

2024-02-07 10:40:33

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 1/2] drm: display: make dp_aux_bus_type const

On Tue, 6 Feb 2024 at 17:03, Daniel Vetter <[email protected]> wrote:
>
> On Sun, Feb 04, 2024 at 10:24:46AM +0100, Dmitry Baryshkov wrote:
> > On Sat, 3 Feb 2024 at 22:20, Ricardo B. Marliere <[email protected]> wrote:
> > >
> > > Now that the driver core can properly handle constant struct bus_type,
> > > move the dp_aux_bus_type variable to be a constant structure as well,
> > > placing it into read-only memory which can not be modified at runtime.
> > >
> > > Cc: Greg Kroah-Hartman <[email protected]>
> > > Suggested-by: Greg Kroah-Hartman <[email protected]>
> > > Signed-off-by: Ricardo B. Marliere <[email protected]>
> >
> > Reviewed-by: Dmitry Baryshkov <[email protected]>
>
> Just to make sure this doesn't fall through cracks, I'm assuming you'll
> push this to drm-misc-next too, right?

I was out at FOSDEM, now done.

--
With best wishes
Dmitry