diff mbox series

[RFC,09/57] drivers: sound: rockchip: rk3399: Use bus_find_device_by_of_node helper

Message ID 1559577023-558-10-git-send-email-suzuki.poulose@arm.com
State New
Headers show
Series [RFC,01/57] drivers: s390/cio: Use driver_for_each_device | expand

Commit Message

Suzuki K Poulose June 3, 2019, 3:49 p.m. UTC
Switch to using the bus_find_device_by_of_node helper

Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

---
 sound/soc/rockchip/rk3399_gru_sound.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

-- 
2.7.4

Comments

Mark Brown June 3, 2019, 4:02 p.m. UTC | #1
On Mon, Jun 03, 2019 at 04:49:35PM +0100, Suzuki K Poulose wrote:
> Switch to using the bus_find_device_by_of_node helper


Please use subject lines matching the style for the subsystem.  This
makes it easier for people to identify relevant patches.

Acked-by: Mark Brown <broonie@kernel.org>
diff mbox series

Patch

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 3d0cc6e..677c92c 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -405,11 +405,6 @@  static const struct dailink_match_data dailink_match[] = {
 	},
 };
 
-static int of_dev_node_match(struct device *dev, void *data)
-{
-	return dev->of_node == data;
-}
-
 static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 {
 	struct device *dev;
@@ -421,8 +416,8 @@  static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 			continue;
 
 		if (dailink_match[i].bus_type) {
-			dev = bus_find_device(dailink_match[i].bus_type, NULL,
-					      np_codec, of_dev_node_match);
+			dev = bus_find_device_by_of_node(dailink_match[i].bus_type,
+							 NULL, np_codec);
 			if (!dev)
 				continue;
 			put_device(dev);