[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220330115122.1671763-35-sashal@kernel.org>
Date: Wed, 30 Mar 2022 07:51:20 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>,
Mark Brown <broonie@...nel.org>,
Sasha Levin <sashal@...nel.org>, lgirdwood@...il.com,
perex@...ex.cz, tiwai@...e.com, alsa-devel@...a-project.org
Subject: [PATCH AUTOSEL 5.10 35/37] ASoC: ak4642: Use of_device_get_match_data()
From: Minghao Chi <chi.minghao@....com.cn>
[ Upstream commit 835ca59799f5c60b4b54bdc7aa785c99552f63e4 ]
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
Link: https://lore.kernel.org/r/20220315023226.2118354-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.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 8d663e8d64c4..7687ec0ebc79 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
Powered by blists - more mailing lists