[PATCH 0/2] ALSA: 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]).
--- [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make...
To: Johannes Berg johannes@sipsolutions.net To: Jaroslav Kysela perex@perex.cz To: Takashi Iwai tiwai@suse.com Cc: linuxppc-dev@lists.ozlabs.org Cc: alsa-devel@alsa-project.org Cc: linux-sound@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Ricardo B. Marliere ricardo@marliere.net
--- Ricardo B. Marliere (2): ALSA: aoa: make soundbus_bus_type const ALSA: seq: make snd_seq_bus_type const
sound/aoa/soundbus/core.c | 2 +- sound/core/seq_device.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- base-commit: d7bf73809849463f76de42aad62c850305dd6c5d change-id: 20240214-bus_cleanup-alsa-1d05ffc6507b
Best regards,
Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the soundbus_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 --- sound/aoa/soundbus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c index 8f24a3eea16b..2a295f610594 100644 --- a/sound/aoa/soundbus/core.c +++ b/sound/aoa/soundbus/core.c @@ -127,7 +127,7 @@ static void soundbus_device_shutdown(struct device *dev)
/* soundbus_dev_attrs is declared in sysfs.c */ ATTRIBUTE_GROUPS(soundbus_dev); -static struct bus_type soundbus_bus_type = { +static const struct bus_type soundbus_bus_type = { .name = "aoa-soundbus", .probe = soundbus_probe, .uevent = soundbus_uevent,
Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the snd_seq_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 --- sound/core/seq_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/seq_device.c b/sound/core/seq_device.c index 7f3fd8eb016f..654d620d0199 100644 --- a/sound/core/seq_device.c +++ b/sound/core/seq_device.c @@ -49,7 +49,7 @@ static int snd_seq_bus_match(struct device *dev, struct device_driver *drv) sdrv->argsize == sdev->argsize; }
-static struct bus_type snd_seq_bus_type = { +static const struct bus_type snd_seq_bus_type = { .name = "snd_seq", .match = snd_seq_bus_match, };
On Wed, Feb 14, 2024 at 04:28:27PM -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]).
To: Johannes Berg johannes@sipsolutions.net To: Jaroslav Kysela perex@perex.cz To: Takashi Iwai tiwai@suse.com Cc: linuxppc-dev@lists.ozlabs.org Cc: alsa-devel@alsa-project.org Cc: linux-sound@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Ricardo B. Marliere ricardo@marliere.net
Reviewed-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
On Wed, 14 Feb 2024 20:28:27 +0100, 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]).
To: Johannes Berg johannes@sipsolutions.net To: Jaroslav Kysela perex@perex.cz To: Takashi Iwai tiwai@suse.com Cc: linuxppc-dev@lists.ozlabs.org Cc: alsa-devel@alsa-project.org Cc: linux-sound@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Ricardo B. Marliere ricardo@marliere.net
Ricardo B. Marliere (2): ALSA: aoa: make soundbus_bus_type const ALSA: seq: make snd_seq_bus_type const
Applied both patches now. Thanks.
Takashi
participants (3)
-
Greg Kroah-Hartman
-
Ricardo B. Marliere
-
Takashi Iwai