lkml.org 
[lkml]   [2022]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH AUTOSEL 4.19 22/22] ASoC: ak4642: Use of_device_get_match_data()
Date
From: Minghao Chi <chi.minghao@zte.com.cn>

[ Upstream commit 835ca59799f5c60b4b54bdc7aa785c99552f63e4 ]

Use of_device_get_match_data() to simplify the code.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220315023226.2118354-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/ak4613.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c
index c1181a20714d..f508e8bdef3b 100644
--- a/sound/soc/codecs/ak4613.c
+++ b/sound/soc/codecs/ak4613.c
@@ -642,15 +642,10 @@ static int ak4613_i2c_probe(struct i2c_client *i2c,
struct ak4613_priv *priv;

regmap_cfg = NULL;
- if (np) {
- const struct of_device_id *of_id;
-
- of_id = of_match_device(ak4613_of_match, dev);
- if (of_id)
- regmap_cfg = of_id->data;
- } else {
+ if (np)
+ regmap_cfg = of_device_get_match_data(dev);
+ else
regmap_cfg = (const struct regmap_config *)id->driver_data;
- }

if (!regmap_cfg)
return -EINVAL;
--
2.34.1
\
 
 \ /
  Last update: 2022-03-30 14:22    [W:0.139 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site