Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH 0/3] drivers: mmc: struct bus_type cleanup
@ 2024-02-03 19:01 Ricardo B. Marliere
  2024-02-03 19:02 ` [PATCH 1/3] mmc: core: make mmc_rpmb_bus_type const Ricardo B. Marliere
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 19:01 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, 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

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

---
Ricardo B. Marliere (3):
      mmc: core: make mmc_rpmb_bus_type const
      mmc: core: make mmc_bus_type const
      mmc: core: make sdio_bus_type const

 drivers/mmc/core/block.c    | 2 +-
 drivers/mmc/core/bus.c      | 2 +-
 drivers/mmc/core/sdio_bus.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 4e99ffb173faaf38f010acb369bff57a20e9e531
change-id: 20240203-bus_cleanup-mmc-008abb80c43d

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


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

* [PATCH 1/3] mmc: core: make mmc_rpmb_bus_type const
  2024-02-03 19:01 [PATCH 0/3] drivers: mmc: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-03 19:02 ` Ricardo B. Marliere
  2024-02-03 19:02 ` [PATCH 2/3] mmc: core: make mmc_bus_type const Ricardo B. Marliere
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 19:02 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the mmc_rpmb_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/mmc/core/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index a9b60b91e32f..bd165cef2bbc 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -144,7 +144,7 @@ struct mmc_blk_data {
 static dev_t mmc_rpmb_devt;
 
 /* Bus type for RPMB character devices */
-static struct bus_type mmc_rpmb_bus_type = {
+static const struct bus_type mmc_rpmb_bus_type = {
 	.name = "mmc_rpmb",
 };
 

-- 
2.43.0


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

* [PATCH 2/3] mmc: core: make mmc_bus_type const
  2024-02-03 19:01 [PATCH 0/3] drivers: mmc: struct bus_type cleanup Ricardo B. Marliere
  2024-02-03 19:02 ` [PATCH 1/3] mmc: core: make mmc_rpmb_bus_type const Ricardo B. Marliere
@ 2024-02-03 19:02 ` Ricardo B. Marliere
  2024-02-03 19:02 ` [PATCH 3/3] mmc: core: make sdio_bus_type const Ricardo B. Marliere
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 19:02 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the mmc_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/mmc/core/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 0af96548e7da..48daeafdff7a 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -214,7 +214,7 @@ static const struct dev_pm_ops mmc_bus_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(mmc_bus_suspend, mmc_bus_resume)
 };
 
-static struct bus_type mmc_bus_type = {
+static const struct bus_type mmc_bus_type = {
 	.name		= "mmc",
 	.dev_groups	= mmc_dev_groups,
 	.uevent		= mmc_bus_uevent,

-- 
2.43.0


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

* [PATCH 3/3] mmc: core: make sdio_bus_type const
  2024-02-03 19:01 [PATCH 0/3] drivers: mmc: struct bus_type cleanup Ricardo B. Marliere
  2024-02-03 19:02 ` [PATCH 1/3] mmc: core: make mmc_rpmb_bus_type const Ricardo B. Marliere
  2024-02-03 19:02 ` [PATCH 2/3] mmc: core: make mmc_bus_type const Ricardo B. Marliere
@ 2024-02-03 19:02 ` Ricardo B. Marliere
  2024-02-03 21:23 ` [PATCH 0/3] drivers: mmc: struct bus_type cleanup Greg Kroah-Hartman
  2024-02-05 17:28 ` Ulf Hansson
  4 siblings, 0 replies; 6+ messages in thread
From: Ricardo B. Marliere @ 2024-02-03 19:02 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the sdio_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/mmc/core/sdio_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 47a48e902a24..71d885fbc228 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -244,7 +244,7 @@ static const struct dev_pm_ops sdio_bus_pm_ops = {
 	)
 };
 
-static struct bus_type sdio_bus_type = {
+static const struct bus_type sdio_bus_type = {
 	.name		= "sdio",
 	.dev_groups	= sdio_dev_groups,
 	.match		= sdio_bus_match,

-- 
2.43.0


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

* Re: [PATCH 0/3] drivers: mmc: struct bus_type cleanup
  2024-02-03 19:01 [PATCH 0/3] drivers: mmc: struct bus_type cleanup Ricardo B. Marliere
                   ` (2 preceding siblings ...)
  2024-02-03 19:02 ` [PATCH 3/3] mmc: core: make sdio_bus_type const Ricardo B. Marliere
@ 2024-02-03 21:23 ` Greg Kroah-Hartman
  2024-02-05 17:28 ` Ulf Hansson
  4 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-03 21:23 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Ulf Hansson, linux-mmc, linux-kernel

On Sat, Feb 03, 2024 at 04:01:59PM -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
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH 0/3] drivers: mmc: struct bus_type cleanup
  2024-02-03 19:01 [PATCH 0/3] drivers: mmc: struct bus_type cleanup Ricardo B. Marliere
                   ` (3 preceding siblings ...)
  2024-02-03 21:23 ` [PATCH 0/3] drivers: mmc: struct bus_type cleanup Greg Kroah-Hartman
@ 2024-02-05 17:28 ` Ulf Hansson
  4 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2024-02-05 17:28 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: linux-mmc, linux-kernel, Greg Kroah-Hartman

On Sat, 3 Feb 2024 at 20:01, Ricardo B. Marliere <ricardo@marliere.net> 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
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
>
> ---
> Ricardo B. Marliere (3):
>       mmc: core: make mmc_rpmb_bus_type const
>       mmc: core: make mmc_bus_type const
>       mmc: core: make sdio_bus_type const
>
>  drivers/mmc/core/block.c    | 2 +-
>  drivers/mmc/core/bus.c      | 2 +-
>  drivers/mmc/core/sdio_bus.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> ---
> base-commit: 4e99ffb173faaf38f010acb369bff57a20e9e531
> change-id: 20240203-bus_cleanup-mmc-008abb80c43d
>
> Best regards,
> --
> Ricardo B. Marliere <ricardo@marliere.net>

Applied for next, thanks!

Kind regards
Uffe

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

end of thread, other threads:[~2024-02-05 17:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-03 19:01 [PATCH 0/3] drivers: mmc: struct bus_type cleanup Ricardo B. Marliere
2024-02-03 19:02 ` [PATCH 1/3] mmc: core: make mmc_rpmb_bus_type const Ricardo B. Marliere
2024-02-03 19:02 ` [PATCH 2/3] mmc: core: make mmc_bus_type const Ricardo B. Marliere
2024-02-03 19:02 ` [PATCH 3/3] mmc: core: make sdio_bus_type const Ricardo B. Marliere
2024-02-03 21:23 ` [PATCH 0/3] drivers: mmc: struct bus_type cleanup Greg Kroah-Hartman
2024-02-05 17:28 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox