ASoC: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:49 +0000 (11:15 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 2 Aug 2019 11:12:31 +0000 (12:12 +0100)
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-50-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
28 files changed:
sound/soc/atmel/atmel-classd.c
sound/soc/atmel/atmel-pdmic.c
sound/soc/bcm/cygnus-ssp.c
sound/soc/codecs/msm8916-wcd-analog.c
sound/soc/codecs/twl6040.c
sound/soc/fsl/fsl_asrc.c
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_sai.c
sound/soc/fsl/fsl_spdif.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/imx-ssi.c
sound/soc/kirkwood/kirkwood-i2s.c
sound/soc/mediatek/common/mtk-btcvsd.c
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
sound/soc/mxs/mxs-saif.c
sound/soc/qcom/lpass-platform.c
sound/soc/sof/intel/bdw.c
sound/soc/sof/intel/byt.c
sound/soc/sprd/sprd-mcdt.c
sound/soc/sti/sti_uniperif.c
sound/soc/stm/stm32_i2s.c
sound/soc/stm/stm32_sai.c
sound/soc/stm/stm32_spdifrx.c
sound/soc/sunxi/sun4i-i2s.c
sound/soc/uniphier/aio-dma.c
sound/soc/xilinx/xlnx_formatter_pcm.c
sound/soc/xtensa/xtfpga-i2s.c

index 0f2c574f27f11316509b31579c7b551312df3903..e98601eccfa337fdd3da7873a0120fbb66fa3415 100644 (file)
@@ -571,11 +571,8 @@ static int atmel_classd_probe(struct platform_device *pdev)
        dd->pdata = pdata;
 
        dd->irq = platform_get_irq(pdev, 0);
-       if (dd->irq < 0) {
-               ret = dd->irq;
-               dev_err(dev, "failed to could not get irq: %d\n", ret);
-               return ret;
-       }
+       if (dd->irq < 0)
+               return dd->irq;
 
        dd->pclk = devm_clk_get(dev, "pclk");
        if (IS_ERR(dd->pclk)) {
index e09c28349e0d208629ca628bb123d605d1cd93de..04ec6f0af17987851a456d0b82a13aa434767e67 100644 (file)
@@ -612,11 +612,8 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
        dd->dev = dev;
 
        dd->irq = platform_get_irq(pdev, 0);
-       if (dd->irq < 0) {
-               ret = dd->irq;
-               dev_err(dev, "failed to get irq: %d\n", ret);
-               return ret;
-       }
+       if (dd->irq < 0)
+               return dd->irq;
 
        dd->pclk = devm_clk_get(dev, "pclk");
        if (IS_ERR(dd->pclk)) {
index b7c358b48d8df11c88d5ea23994c6ed7de8856aa..2f9357d7da96d20c786b92014905da9b2b799e90 100644 (file)
@@ -1342,11 +1342,8 @@ static int cygnus_ssp_probe(struct platform_device *pdev)
        }
 
        cygaud->irq_num = platform_get_irq(pdev, 0);
-       if (cygaud->irq_num <= 0) {
-               dev_err(dev, "platform_get_irq failed\n");
-               err = cygaud->irq_num;
-               return err;
-       }
+       if (cygaud->irq_num <= 0)
+               return cygaud->irq_num;
 
        err = audio_clk_init(pdev, cygaud);
        if (err) {
index 368b6c09474bb8427f4985c15a1ee3fc158c9166..667e9f73aba3850401d2164b9ca143affceb0cf6 100644 (file)
@@ -1185,10 +1185,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq_byname(pdev, "mbhc_switch_int");
-       if (irq < 0) {
-               dev_err(dev, "failed to get mbhc switch irq\n");
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_threaded_irq(dev, irq, NULL,
                               pm8916_mbhc_switch_irq_handler,
@@ -1200,10 +1198,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
 
        if (priv->mbhc_btn_enabled) {
                irq = platform_get_irq_byname(pdev, "mbhc_but_press_det");
-               if (irq < 0) {
-                       dev_err(dev, "failed to get button press irq\n");
+               if (irq < 0)
                        return irq;
-               }
 
                ret = devm_request_threaded_irq(dev, irq, NULL,
                                       mbhc_btn_press_irq_handler,
@@ -1214,10 +1210,8 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev)
                        dev_err(dev, "cannot request mbhc button press irq\n");
 
                irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det");
-               if (irq < 0) {
-                       dev_err(dev, "failed to get button release irq\n");
+               if (irq < 0)
                        return irq;
-               }
 
                ret = devm_request_threaded_irq(dev, irq, NULL,
                                       mbhc_btn_release_irq_handler,
index 472c2fff34a8237e43c88e32468a4a3b84094100..f34637afee515872b66581144abe0335aa65b8a5 100644 (file)
@@ -1108,10 +1108,8 @@ static int twl6040_probe(struct snd_soc_component *component)
        priv->component = component;
 
        priv->plug_irq = platform_get_irq(pdev, 0);
-       if (priv->plug_irq < 0) {
-               dev_err(component->dev, "invalid irq: %d\n", priv->plug_irq);
+       if (priv->plug_irq < 0)
                return priv->plug_irq;
-       }
 
        INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work);
 
index cbbf6257f08a708f77aaf8d848c78e43769f9976..cfa40ef6b1ca7604c3373c31c7f6a195de4d2cbb 100644 (file)
@@ -885,10 +885,8 @@ static int fsl_asrc_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
                               dev_name(&pdev->dev), asrc_priv);
index 4ce8ac769244bd131919ac46f23104ddf418d515..5832144beb9f55b0c5d6c744f0c7140e0f843403 100644 (file)
@@ -962,10 +962,8 @@ static int fsl_esai_probe(struct platform_device *pdev)
                                PTR_ERR(esai_priv->spbaclk));
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
                               esai_priv->name, esai_priv);
index 6d3c6c8d50cefe2beaff7977a428fca089223002..8f4d9fa955996b5563ade684f9201e1fd8ce7b43 100644 (file)
@@ -831,10 +831,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
        if (ret) {
index 4842e6df9a2d76741a7468516effbac9fe6cc5a8..7858a5499ac5d0b5b648e0fea2fadc708bdc4e60 100644 (file)
@@ -1248,10 +1248,8 @@ static int fsl_spdif_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
                               dev_name(&pdev->dev), spdif_priv);
index fa862af25c1a35792521a15ef7f423e8da29e345..b0a6fead1a6aff8bb756f37698ecc5ccd2fe9441 100644 (file)
@@ -1510,10 +1510,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
        }
 
        ssi->irq = platform_get_irq(pdev, 0);
-       if (ssi->irq < 0) {
-               dev_err(dev, "no irq for node %s\n", pdev->name);
+       if (ssi->irq < 0)
                return ssi->irq;
-       }
 
        /* Set software limitations for synchronous mode except AC97 */
        if (ssi->synchronous && !fsl_ssi_is_ac97(ssi)) {
index 9038b61317be1a8e2d779f41e2e1561021144e38..42031ba7da3172e500a47d06818992d3c3480be1 100644 (file)
@@ -520,10 +520,8 @@ static int imx_ssi_probe(struct platform_device *pdev)
        }
 
        ssi->irq = platform_get_irq(pdev, 0);
-       if (ssi->irq < 0) {
-               dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq);
+       if (ssi->irq < 0)
                return ssi->irq;
-       }
 
        ssi->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(ssi->clk)) {
index 5076ec4cc7a610c3bd1d832d73bc17e70f684f2d..61226fefe1c4bc13bbb916faf56f5728d65ce0e9 100644 (file)
@@ -537,10 +537,8 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
                return PTR_ERR(priv->io);
 
        priv->irq = platform_get_irq(pdev, 0);
-       if (priv->irq < 0) {
-               dev_err(&pdev->dev, "platform_get_irq failed: %d\n", priv->irq);
+       if (priv->irq < 0)
                return priv->irq;
-       }
 
        if (np) {
                priv->burst = 128;              /* might be 32 or 128 */
index c7a81c4be0687a25970502c6be77ed05e660c0d4..d00608c73c6ec404b3563437600943efb96a8d4b 100644 (file)
@@ -1335,10 +1335,8 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)
 
        /* irq */
        irq_id = platform_get_irq(pdev, 0);
-       if (irq_id <= 0) {
-               dev_err(dev, "%pOFn no irq found\n", dev->of_node);
+       if (irq_id <= 0)
                return irq_id < 0 ? irq_id : -ENXIO;
-       }
 
        ret = devm_request_irq(dev, irq_id, mtk_btcvsd_snd_irq_handler,
                               IRQF_TRIGGER_LOW, "BTCVSD_ISR_Handle",
index 7064a9fd6f748b068bbcb083806c47c834759c80..9af76ae315a54a2503bf91a8d39d11d9141e2018 100644 (file)
@@ -1342,10 +1342,8 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        irq_id = platform_get_irq_byname(pdev, "asys");
-       if (irq_id < 0) {
-               dev_err(dev, "unable to get ASYS IRQ\n");
+       if (irq_id < 0)
                return irq_id;
-       }
 
        ret = devm_request_irq(dev, irq_id, mt2701_asys_isr,
                               IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
index 90bd2c92cae720b7240f0b3c6896c086ea0eead4..0ee29255e73198ae499c5e782f731a1395d1e26e 100644 (file)
@@ -1074,10 +1074,8 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
        afe->dev = &pdev->dev;
 
        irq_id = platform_get_irq(pdev, 0);
-       if (irq_id <= 0) {
-               dev_err(afe->dev, "np %pOFn no irq\n", afe->dev->of_node);
+       if (irq_id <= 0)
                return irq_id < 0 ? irq_id : -ENXIO;
-       }
        ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
                               0, "Afe_ISR_Handle", (void *)afe);
        if (ret) {
index a2c79426513bba616e2b0dbdce7587a00618062b..1e38ce858326232ee11f345910eb775b92ae804b 100644 (file)
@@ -790,12 +790,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
                return PTR_ERR(saif->base);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               ret = irq;
-               dev_err(&pdev->dev, "failed to get irq resource: %d\n",
-                       ret);
-               return ret;
-       }
+       if (irq < 0)
+               return irq;
 
        saif->dev = &pdev->dev;
        ret = devm_request_irq(&pdev->dev, irq, mxs_saif_irq, 0,
index cf7a299f45470062add9b3793af1e49107ded43c..4c745baa39f738ab1407fe0eab971f401bbba1d9 100644 (file)
@@ -564,11 +564,8 @@ int asoc_qcom_lpass_platform_register(struct platform_device *pdev)
        int ret;
 
        drvdata->lpaif_irq = platform_get_irq_byname(pdev, "lpass-irq-lpaif");
-       if (drvdata->lpaif_irq < 0) {
-               dev_err(&pdev->dev, "error getting irq handle: %d\n",
-                       drvdata->lpaif_irq);
+       if (drvdata->lpaif_irq < 0)
                return -ENODEV;
-       }
 
        /* ensure audio hardware is disabled */
        ret = regmap_write(drvdata->lpaif_map,
index 70d524ef9bc07d220e09e21f9cdd3a245017a09d..4bb9636da9903191dafeca88dc872d24b75a4349 100644 (file)
@@ -613,11 +613,8 @@ static int bdw_probe(struct snd_sof_dev *sdev)
 
        /* register our IRQ */
        sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
-       if (sdev->ipc_irq < 0) {
-               dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
-                       desc->irqindex_host_ipc);
+       if (sdev->ipc_irq < 0)
                return sdev->ipc_irq;
-       }
 
        dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
        ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
index 107d711efc3f05fb24b8c202287ab0eaf7b7a80f..000d576f6a8d982a22ae89b12bb2e72d3df30a1b 100644 (file)
@@ -728,11 +728,8 @@ static int byt_acpi_probe(struct snd_sof_dev *sdev)
 irq:
        /* register our IRQ */
        sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
-       if (sdev->ipc_irq < 0) {
-               dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
-                       desc->irqindex_host_ipc);
+       if (sdev->ipc_irq < 0)
                return sdev->ipc_irq;
-       }
 
        dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
        ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
index 7448015a493561a5e28e0db0bc6303ef1101e41c..f439e5503a3c0d97290c6063ced234d89892cbb8 100644 (file)
@@ -959,10 +959,8 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, mcdt);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "Failed to get MCDT interrupt\n");
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, sprd_mcdt_irq_handler,
                               0, "sprd-mcdt", mcdt);
index 645bcbe91601336dd9b7b06e386e3b5ac2309a37..ee4a0151e63ecb2e2d32f6e2e385595fcdcaaedc 100644 (file)
@@ -426,10 +426,8 @@ static int sti_uniperiph_cpu_dai_of(struct device_node *node,
                                     UNIPERIF_FIFO_DATA_OFFSET(uni);
 
        uni->irq = platform_get_irq(priv->pdev, 0);
-       if (uni->irq < 0) {
-               dev_err(dev, "Failed to get IRQ resource\n");
+       if (uni->irq < 0)
                return -ENXIO;
-       }
 
        uni->type = dev_data->type;
 
index ba6452dab69b37633cc80188df01dc3470a6ec40..3e7226a53e53ae4be524d2c66b61204adb6a4add 100644 (file)
@@ -855,11 +855,8 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
 
        /* Get irqs */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               if (irq != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, IRQF_ONESHOT,
                               dev_name(&pdev->dev), i2s);
index 1ac5103cea78409349b0e2e8f2687852a35e4852..ef4273361d0d8dfe98b53c92ece167b05ec7fde4 100644 (file)
@@ -193,10 +193,8 @@ static int stm32_sai_probe(struct platform_device *pdev)
 
        /* init irqs */
        sai->irq = platform_get_irq(pdev, 0);
-       if (sai->irq < 0) {
-               dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
+       if (sai->irq < 0)
                return sai->irq;
-       }
 
        /* reset */
        rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
index ee71b898897bd62b1e1884d869c97b2a4484fcb1..cd4b235fce575e776a18685c9a8f17e9b7e7d5d8 100644 (file)
@@ -909,10 +909,8 @@ static int stm32_spdifrx_parse_of(struct platform_device *pdev,
        }
 
        spdifrx->irq = platform_get_irq(pdev, 0);
-       if (spdifrx->irq < 0) {
-               dev_err(&pdev->dev, "No irq for node %s\n", pdev->name);
+       if (spdifrx->irq < 0)
                return spdifrx->irq;
-       }
 
        return 0;
 }
index 9b2232908b6528a6adc10bf82bb9682d4e7c004c..d97d694c48dfed0dc0be92c6de5170d34ce4cdd8 100644 (file)
@@ -1087,10 +1087,8 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
                return PTR_ERR(regs);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "Can't retrieve our interrupt\n");
+       if (irq < 0)
                return irq;
-       }
 
        i2s->variant = of_device_get_match_data(&pdev->dev);
        if (!i2s->variant) {
index 862346d667741cdb623b1b9e379bf45e1d983f3c..e8446cc4e8f81c4770d83bfddbef87acbf8b8f05 100644 (file)
@@ -289,10 +289,8 @@ int uniphier_aiodma_soc_register_platform(struct platform_device *pdev)
                return PTR_ERR(chip->regmap);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "Could not get irq.\n");
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(dev, irq, aiodma_irq,
                               IRQF_SHARED, dev_name(dev), pdev);
index dc8721f4f56bf4620c25013bc8e7276cda9a6217..48970efe7838e0bd010b28f7d8eea85bcc01d4d8 100644 (file)
@@ -613,7 +613,6 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
                aud_drv_data->mm2s_irq = platform_get_irq_byname(pdev,
                                                                 "irq_mm2s");
                if (aud_drv_data->mm2s_irq < 0) {
-                       dev_err(dev, "xlnx audio mm2s irq resource failed\n");
                        ret = aud_drv_data->mm2s_irq;
                        goto clk_err;
                }
@@ -640,7 +639,6 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
                aud_drv_data->s2mm_irq = platform_get_irq_byname(pdev,
                                                                 "irq_s2mm");
                if (aud_drv_data->s2mm_irq < 0) {
-                       dev_err(dev, "xlnx audio s2mm irq resource failed\n");
                        ret = aud_drv_data->s2mm_irq;
                        goto clk_err;
                }
index 9da395d14a8d1a68395674cd680d4587c71c6b7a..efd374f114a03f6dbf7b0d4b5ab6ae1438c68742 100644 (file)
@@ -570,7 +570,6 @@ static int xtfpga_i2s_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource\n");
                err = irq;
                goto err;
        }