dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drivers: drm: struct bus_type cleanup
@ 2024-02-03 18:25 Ricardo B. Marliere
  2024-02-03 18:25 ` [PATCH 1/2] drm: display: make dp_aux_bus_type const Ricardo B. Marliere
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 18:25 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

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 <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc:  <dri-devel@lists.freedesktop.org>
Cc:  <linux-kernel@vger.kernel.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

---
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 <ricardo@marliere.net>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] drm: display: make dp_aux_bus_type const
  2024-02-03 18:25 [PATCH 0/2] drivers: drm: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-03 18:25 ` Ricardo B. Marliere
  2024-02-04  9:24   ` Dmitry Baryshkov
  2024-02-03 18:25 ` [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const Ricardo B. Marliere
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 18:25 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const
  2024-02-03 18:25 [PATCH 0/2] drivers: drm: struct bus_type cleanup Ricardo B. Marliere
  2024-02-03 18:25 ` [PATCH 1/2] drm: display: make dp_aux_bus_type const Ricardo B. Marliere
@ 2024-02-03 18:25 ` Ricardo B. Marliere
  2024-02-04  9:25   ` Dmitry Baryshkov
  2024-02-03 18:36 ` [PATCH 0/2] drivers: drm: struct bus_type cleanup Greg Kroah-Hartman
  2024-02-07 10:39 ` Dmitry Baryshkov
  3 siblings, 1 reply; 9+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 18:25 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] drivers: drm: struct bus_type cleanup
  2024-02-03 18:25 [PATCH 0/2] drivers: drm: struct bus_type cleanup Ricardo B. Marliere
  2024-02-03 18:25 ` [PATCH 1/2] drm: display: make dp_aux_bus_type const Ricardo B. Marliere
  2024-02-03 18:25 ` [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const Ricardo B. Marliere
@ 2024-02-03 18:36 ` Greg Kroah-Hartman
  2024-02-07 10:39 ` Dmitry Baryshkov
  3 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-03 18:36 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel

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 <maarten.lankhorst@linux.intel.com>
> To: Maxime Ripard <mripard@kernel.org>
> To: Thomas Zimmermann <tzimmermann@suse.de>
> To: David Airlie <airlied@gmail.com>
> To: Daniel Vetter <daniel@ffwll.ch>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc:  <dri-devel@lists.freedesktop.org>
> Cc:  <linux-kernel@vger.kernel.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> 
> ---
> 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 <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] drm: display: make dp_aux_bus_type const
  2024-02-03 18:25 ` [PATCH 1/2] drm: display: make dp_aux_bus_type const Ricardo B. Marliere
@ 2024-02-04  9:24   ` Dmitry Baryshkov
  2024-02-06 15:03     ` Daniel Vetter
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Baryshkov @ 2024-02-04  9:24 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel,
	Greg Kroah-Hartman

On Sat, 3 Feb 2024 at 22:20, Ricardo B. Marliere <ricardo@marliere.net> 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 <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

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

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const
  2024-02-03 18:25 ` [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const Ricardo B. Marliere
@ 2024-02-04  9:25   ` Dmitry Baryshkov
  0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2024-02-04  9:25 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel,
	Greg Kroah-Hartman

On Sat, 3 Feb 2024 at 22:20, Ricardo B. Marliere <ricardo@marliere.net> 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 <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---
>  drivers/gpu/drm/drm_mipi_dsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] drm: display: make dp_aux_bus_type const
  2024-02-04  9:24   ` Dmitry Baryshkov
@ 2024-02-06 15:03     ` Daniel Vetter
  2024-02-07 10:39       ` Dmitry Baryshkov
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2024-02-06 15:03 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Ricardo B. Marliere, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel, Greg Kroah-Hartman

On Sun, Feb 04, 2024 at 10:24:46AM +0100, Dmitry Baryshkov wrote:
> On Sat, 3 Feb 2024 at 22:20, Ricardo B. Marliere <ricardo@marliere.net> 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 <gregkh@linuxfoundation.org>
> > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] drivers: drm: struct bus_type cleanup
  2024-02-03 18:25 [PATCH 0/2] drivers: drm: struct bus_type cleanup Ricardo B. Marliere
                   ` (2 preceding siblings ...)
  2024-02-03 18:36 ` [PATCH 0/2] drivers: drm: struct bus_type cleanup Greg Kroah-Hartman
@ 2024-02-07 10:39 ` Dmitry Baryshkov
  3 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2024-02-07 10:39 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Ricardo B. Marliere
  Cc: dri-devel, linux-kernel, Greg Kroah-Hartman

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 <dmitry.baryshkov@linaro.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] drm: display: make dp_aux_bus_type const
  2024-02-06 15:03     ` Daniel Vetter
@ 2024-02-07 10:39       ` Dmitry Baryshkov
  0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2024-02-07 10:39 UTC (permalink / raw)
  To: Dmitry Baryshkov, Ricardo B. Marliere, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, dri-devel,
	linux-kernel, Greg Kroah-Hartman
  Cc: Daniel Vetter

On Tue, 6 Feb 2024 at 17:03, Daniel Vetter <daniel@ffwll.ch> 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 <ricardo@marliere.net> 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 <gregkh@linuxfoundation.org>
> > > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> >
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-07 10:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-03 18:25 [PATCH 0/2] drivers: drm: struct bus_type cleanup Ricardo B. Marliere
2024-02-03 18:25 ` [PATCH 1/2] drm: display: make dp_aux_bus_type const Ricardo B. Marliere
2024-02-04  9:24   ` Dmitry Baryshkov
2024-02-06 15:03     ` Daniel Vetter
2024-02-07 10:39       ` Dmitry Baryshkov
2024-02-03 18:25 ` [PATCH 2/2] drm: mipi-dsi: make mipi_dsi_bus_type const Ricardo B. Marliere
2024-02-04  9:25   ` Dmitry Baryshkov
2024-02-03 18:36 ` [PATCH 0/2] drivers: drm: struct bus_type cleanup Greg Kroah-Hartman
2024-02-07 10:39 ` Dmitry Baryshkov

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).