ASoC: codecs: max9860: Use dev_err_probe() helper
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 14 Dec 2021 02:08:25 +0000 (11:08 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 20 Dec 2021 12:47:05 +0000 (12:47 +0000)
Use the dev_err_probe() helper, instead of open-coding the same
operation.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20211214020843.2225831-5-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max9860.c

index dd29b183ecd6c89f0b17e70214ae82d7a9b1047c..7c9686be59d99dda20d072be212cc3bcf090f29b 100644 (file)
@@ -606,12 +606,9 @@ static int max9860_probe(struct i2c_client *i2c)
                return -ENOMEM;
 
        max9860->dvddio = devm_regulator_get(dev, "DVDDIO");
-       if (IS_ERR(max9860->dvddio)) {
-               ret = PTR_ERR(max9860->dvddio);
-               if (ret != -EPROBE_DEFER)
-                       dev_err(dev, "Failed to get DVDDIO supply: %d\n", ret);
-               return ret;
-       }
+       if (IS_ERR(max9860->dvddio))
+               return dev_err_probe(dev, PTR_ERR(max9860->dvddio),
+                                    "Failed to get DVDDIO supply\n");
 
        max9860->dvddio_nb.notifier_call = max9860_dvddio_event;
 
@@ -643,8 +640,7 @@ static int max9860_probe(struct i2c_client *i2c)
 
        if (IS_ERR(mclk)) {
                ret = PTR_ERR(mclk);
-               if (ret != -EPROBE_DEFER)
-                       dev_err(dev, "Failed to get MCLK: %d\n", ret);
+               dev_err_probe(dev, ret, "Failed to get MCLK\n");
                goto err_regulator;
        }