]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: ak4642: Use of_device_get_match_data()
authorMinghao Chi <chi.minghao@zte.com.cn>
Tue, 15 Mar 2022 02:32:26 +0000 (02:32 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 16 Mar 2022 16:39:33 +0000 (16:39 +0000)
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>
sound/soc/codecs/ak4613.c

index 4d2e78101f28cad4daafb1ca4a545a2e9668df0d..034195c83bd7e10af62ce1ea6f7e1eac690015b2 100644 (file)
@@ -653,15 +653,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;