kernel: bump 5.4 to 5.4.114
[openwrt/openwrt.git] / target / linux / layerscape / patches-5.4 / 801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch
1 From b3aa9fe657c5e96659d64e6b008e025b433616ad Mon Sep 17 00:00:00 2001
2 From: Dong Aisheng <aisheng.dong@nxp.com>
3 Date: Fri, 16 Aug 2019 18:01:53 +0800
4 Subject: [PATCH] Revert "ASoC: Remove dev_err() usage after
5 platform_get_irq()"
6
7 This reverts commit cf9441adb1a35506d7606866c382b9d8614169b5.
8 ---
9 sound/soc/atmel/atmel-classd.c | 7 +++++--
10 sound/soc/atmel/atmel-pdmic.c | 7 +++++--
11 sound/soc/bcm/cygnus-ssp.c | 7 +++++--
12 sound/soc/codecs/msm8916-wcd-analog.c | 12 +++++++++---
13 sound/soc/codecs/twl6040.c | 4 +++-
14 sound/soc/fsl/fsl_asrc.c | 4 +++-
15 sound/soc/fsl/fsl_esai.c | 4 +++-
16 sound/soc/fsl/fsl_sai.c | 4 +++-
17 sound/soc/fsl/fsl_spdif.c | 4 +++-
18 sound/soc/fsl/fsl_ssi.c | 4 +++-
19 sound/soc/fsl/imx-ssi.c | 4 +++-
20 sound/soc/kirkwood/kirkwood-i2s.c | 4 +++-
21 sound/soc/mediatek/common/mtk-btcvsd.c | 4 +++-
22 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 4 +++-
23 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 4 +++-
24 sound/soc/mxs/mxs-saif.c | 8 ++++++--
25 sound/soc/qcom/lpass-platform.c | 5 ++++-
26 sound/soc/sof/intel/bdw.c | 5 ++++-
27 sound/soc/sof/intel/byt.c | 5 ++++-
28 sound/soc/sprd/sprd-mcdt.c | 4 +++-
29 sound/soc/sti/sti_uniperif.c | 4 +++-
30 sound/soc/stm/stm32_i2s.c | 5 ++++-
31 sound/soc/stm/stm32_sai.c | 4 +++-
32 sound/soc/stm/stm32_spdifrx.c | 4 +++-
33 sound/soc/sunxi/sun4i-i2s.c | 4 +++-
34 sound/soc/uniphier/aio-dma.c | 4 +++-
35 sound/soc/xilinx/xlnx_formatter_pcm.c | 2 ++
36 sound/soc/xtensa/xtfpga-i2s.c | 1 +
37 28 files changed, 100 insertions(+), 32 deletions(-)
38
39 --- a/sound/soc/atmel/atmel-classd.c
40 +++ b/sound/soc/atmel/atmel-classd.c
41 @@ -571,8 +571,11 @@ static int atmel_classd_probe(struct pla
42 dd->pdata = pdata;
43
44 dd->irq = platform_get_irq(pdev, 0);
45 - if (dd->irq < 0)
46 - return dd->irq;
47 + if (dd->irq < 0) {
48 + ret = dd->irq;
49 + dev_err(dev, "failed to could not get irq: %d\n", ret);
50 + return ret;
51 + }
52
53 dd->pclk = devm_clk_get(dev, "pclk");
54 if (IS_ERR(dd->pclk)) {
55 --- a/sound/soc/atmel/atmel-pdmic.c
56 +++ b/sound/soc/atmel/atmel-pdmic.c
57 @@ -612,8 +612,11 @@ static int atmel_pdmic_probe(struct plat
58 dd->dev = dev;
59
60 dd->irq = platform_get_irq(pdev, 0);
61 - if (dd->irq < 0)
62 - return dd->irq;
63 + if (dd->irq < 0) {
64 + ret = dd->irq;
65 + dev_err(dev, "failed to get irq: %d\n", ret);
66 + return ret;
67 + }
68
69 dd->pclk = devm_clk_get(dev, "pclk");
70 if (IS_ERR(dd->pclk)) {
71 --- a/sound/soc/bcm/cygnus-ssp.c
72 +++ b/sound/soc/bcm/cygnus-ssp.c
73 @@ -1342,8 +1342,11 @@ static int cygnus_ssp_probe(struct platf
74 }
75
76 cygaud->irq_num = platform_get_irq(pdev, 0);
77 - if (cygaud->irq_num <= 0)
78 - return cygaud->irq_num;
79 + if (cygaud->irq_num <= 0) {
80 + dev_err(dev, "platform_get_irq failed\n");
81 + err = cygaud->irq_num;
82 + return err;
83 + }
84
85 err = audio_clk_init(pdev, cygaud);
86 if (err) {
87 --- a/sound/soc/codecs/msm8916-wcd-analog.c
88 +++ b/sound/soc/codecs/msm8916-wcd-analog.c
89 @@ -1195,8 +1195,10 @@ static int pm8916_wcd_analog_spmi_probe(
90 }
91
92 irq = platform_get_irq_byname(pdev, "mbhc_switch_int");
93 - if (irq < 0)
94 + if (irq < 0) {
95 + dev_err(dev, "failed to get mbhc switch irq\n");
96 return irq;
97 + }
98
99 ret = devm_request_threaded_irq(dev, irq, NULL,
100 pm8916_mbhc_switch_irq_handler,
101 @@ -1208,8 +1210,10 @@ static int pm8916_wcd_analog_spmi_probe(
102
103 if (priv->mbhc_btn_enabled) {
104 irq = platform_get_irq_byname(pdev, "mbhc_but_press_det");
105 - if (irq < 0)
106 + if (irq < 0) {
107 + dev_err(dev, "failed to get button press irq\n");
108 return irq;
109 + }
110
111 ret = devm_request_threaded_irq(dev, irq, NULL,
112 mbhc_btn_press_irq_handler,
113 @@ -1220,8 +1224,10 @@ static int pm8916_wcd_analog_spmi_probe(
114 dev_err(dev, "cannot request mbhc button press irq\n");
115
116 irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det");
117 - if (irq < 0)
118 + if (irq < 0) {
119 + dev_err(dev, "failed to get button release irq\n");
120 return irq;
121 + }
122
123 ret = devm_request_threaded_irq(dev, irq, NULL,
124 mbhc_btn_release_irq_handler,
125 --- a/sound/soc/codecs/twl6040.c
126 +++ b/sound/soc/codecs/twl6040.c
127 @@ -1108,8 +1108,10 @@ static int twl6040_probe(struct snd_soc_
128 priv->component = component;
129
130 priv->plug_irq = platform_get_irq(pdev, 0);
131 - if (priv->plug_irq < 0)
132 + if (priv->plug_irq < 0) {
133 + dev_err(component->dev, "invalid irq: %d\n", priv->plug_irq);
134 return priv->plug_irq;
135 + }
136
137 INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work);
138
139 --- a/sound/soc/fsl/fsl_asrc.c
140 +++ b/sound/soc/fsl/fsl_asrc.c
141 @@ -885,8 +885,10 @@ static int fsl_asrc_probe(struct platfor
142 }
143
144 irq = platform_get_irq(pdev, 0);
145 - if (irq < 0)
146 + if (irq < 0) {
147 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
148 return irq;
149 + }
150
151 ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
152 dev_name(&pdev->dev), asrc_priv);
153 --- a/sound/soc/fsl/fsl_esai.c
154 +++ b/sound/soc/fsl/fsl_esai.c
155 @@ -979,8 +979,10 @@ static int fsl_esai_probe(struct platfor
156 PTR_ERR(esai_priv->spbaclk));
157
158 irq = platform_get_irq(pdev, 0);
159 - if (irq < 0)
160 + if (irq < 0) {
161 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
162 return irq;
163 + }
164
165 ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
166 esai_priv->name, esai_priv);
167 --- a/sound/soc/fsl/fsl_sai.c
168 +++ b/sound/soc/fsl/fsl_sai.c
169 @@ -831,8 +831,10 @@ static int fsl_sai_probe(struct platform
170 }
171
172 irq = platform_get_irq(pdev, 0);
173 - if (irq < 0)
174 + if (irq < 0) {
175 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
176 return irq;
177 + }
178
179 ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
180 if (ret) {
181 --- a/sound/soc/fsl/fsl_spdif.c
182 +++ b/sound/soc/fsl/fsl_spdif.c
183 @@ -1248,8 +1248,10 @@ static int fsl_spdif_probe(struct platfo
184 }
185
186 irq = platform_get_irq(pdev, 0);
187 - if (irq < 0)
188 + if (irq < 0) {
189 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
190 return irq;
191 + }
192
193 ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
194 dev_name(&pdev->dev), spdif_priv);
195 --- a/sound/soc/fsl/fsl_ssi.c
196 +++ b/sound/soc/fsl/fsl_ssi.c
197 @@ -1517,8 +1517,10 @@ static int fsl_ssi_probe(struct platform
198 }
199
200 ssi->irq = platform_get_irq(pdev, 0);
201 - if (ssi->irq < 0)
202 + if (ssi->irq < 0) {
203 + dev_err(dev, "no irq for node %s\n", pdev->name);
204 return ssi->irq;
205 + }
206
207 /* Set software limitations for synchronous mode except AC97 */
208 if (ssi->synchronous && !fsl_ssi_is_ac97(ssi)) {
209 --- a/sound/soc/fsl/imx-ssi.c
210 +++ b/sound/soc/fsl/imx-ssi.c
211 @@ -520,8 +520,10 @@ static int imx_ssi_probe(struct platform
212 }
213
214 ssi->irq = platform_get_irq(pdev, 0);
215 - if (ssi->irq < 0)
216 + if (ssi->irq < 0) {
217 + dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq);
218 return ssi->irq;
219 + }
220
221 ssi->clk = devm_clk_get(&pdev->dev, NULL);
222 if (IS_ERR(ssi->clk)) {
223 --- a/sound/soc/kirkwood/kirkwood-i2s.c
224 +++ b/sound/soc/kirkwood/kirkwood-i2s.c
225 @@ -537,8 +537,10 @@ static int kirkwood_i2s_dev_probe(struct
226 return PTR_ERR(priv->io);
227
228 priv->irq = platform_get_irq(pdev, 0);
229 - if (priv->irq < 0)
230 + if (priv->irq < 0) {
231 + dev_err(&pdev->dev, "platform_get_irq failed: %d\n", priv->irq);
232 return priv->irq;
233 + }
234
235 if (np) {
236 priv->burst = 128; /* might be 32 or 128 */
237 --- a/sound/soc/mediatek/common/mtk-btcvsd.c
238 +++ b/sound/soc/mediatek/common/mtk-btcvsd.c
239 @@ -1335,8 +1335,10 @@ static int mtk_btcvsd_snd_probe(struct p
240
241 /* irq */
242 irq_id = platform_get_irq(pdev, 0);
243 - if (irq_id <= 0)
244 + if (irq_id <= 0) {
245 + dev_err(dev, "%pOFn no irq found\n", dev->of_node);
246 return irq_id < 0 ? irq_id : -ENXIO;
247 + }
248
249 ret = devm_request_irq(dev, irq_id, mtk_btcvsd_snd_irq_handler,
250 IRQF_TRIGGER_LOW, "BTCVSD_ISR_Handle",
251 --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
252 +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
253 @@ -1350,8 +1350,10 @@ static int mt2701_afe_pcm_dev_probe(stru
254 return -ENOMEM;
255
256 irq_id = platform_get_irq_byname(pdev, "asys");
257 - if (irq_id < 0)
258 + if (irq_id < 0) {
259 + dev_err(dev, "unable to get ASYS IRQ\n");
260 return irq_id;
261 + }
262
263 ret = devm_request_irq(dev, irq_id, mt2701_asys_isr,
264 IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
265 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
266 +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
267 @@ -1074,8 +1074,10 @@ static int mt8173_afe_pcm_dev_probe(stru
268 afe->dev = &pdev->dev;
269
270 irq_id = platform_get_irq(pdev, 0);
271 - if (irq_id <= 0)
272 + if (irq_id <= 0) {
273 + dev_err(afe->dev, "np %pOFn no irq\n", afe->dev->of_node);
274 return irq_id < 0 ? irq_id : -ENXIO;
275 + }
276 ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
277 0, "Afe_ISR_Handle", (void *)afe);
278 if (ret) {
279 --- a/sound/soc/mxs/mxs-saif.c
280 +++ b/sound/soc/mxs/mxs-saif.c
281 @@ -790,8 +790,12 @@ static int mxs_saif_probe(struct platfor
282 return PTR_ERR(saif->base);
283
284 irq = platform_get_irq(pdev, 0);
285 - if (irq < 0)
286 - return irq;
287 + if (irq < 0) {
288 + ret = irq;
289 + dev_err(&pdev->dev, "failed to get irq resource: %d\n",
290 + ret);
291 + return ret;
292 + }
293
294 saif->dev = &pdev->dev;
295 ret = devm_request_irq(&pdev->dev, irq, mxs_saif_irq, 0,
296 --- a/sound/soc/qcom/lpass-platform.c
297 +++ b/sound/soc/qcom/lpass-platform.c
298 @@ -568,8 +568,11 @@ int asoc_qcom_lpass_platform_register(st
299 int ret;
300
301 drvdata->lpaif_irq = platform_get_irq_byname(pdev, "lpass-irq-lpaif");
302 - if (drvdata->lpaif_irq < 0)
303 + if (drvdata->lpaif_irq < 0) {
304 + dev_err(&pdev->dev, "error getting irq handle: %d\n",
305 + drvdata->lpaif_irq);
306 return -ENODEV;
307 + }
308
309 /* ensure audio hardware is disabled */
310 ret = regmap_write(drvdata->lpaif_map,
311 --- a/sound/soc/sof/intel/bdw.c
312 +++ b/sound/soc/sof/intel/bdw.c
313 @@ -483,8 +483,11 @@ static int bdw_probe(struct snd_sof_dev
314
315 /* register our IRQ */
316 sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
317 - if (sdev->ipc_irq < 0)
318 + if (sdev->ipc_irq < 0) {
319 + dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
320 + desc->irqindex_host_ipc);
321 return sdev->ipc_irq;
322 + }
323
324 dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
325 ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
326 --- a/sound/soc/sof/intel/byt.c
327 +++ b/sound/soc/sof/intel/byt.c
328 @@ -600,8 +600,11 @@ static int byt_acpi_probe(struct snd_sof
329 irq:
330 /* register our IRQ */
331 sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
332 - if (sdev->ipc_irq < 0)
333 + if (sdev->ipc_irq < 0) {
334 + dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
335 + desc->irqindex_host_ipc);
336 return sdev->ipc_irq;
337 + }
338
339 dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
340 ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
341 --- a/sound/soc/sprd/sprd-mcdt.c
342 +++ b/sound/soc/sprd/sprd-mcdt.c
343 @@ -959,8 +959,10 @@ static int sprd_mcdt_probe(struct platfo
344 platform_set_drvdata(pdev, mcdt);
345
346 irq = platform_get_irq(pdev, 0);
347 - if (irq < 0)
348 + if (irq < 0) {
349 + dev_err(&pdev->dev, "Failed to get MCDT interrupt\n");
350 return irq;
351 + }
352
353 ret = devm_request_irq(&pdev->dev, irq, sprd_mcdt_irq_handler,
354 0, "sprd-mcdt", mcdt);
355 --- a/sound/soc/sti/sti_uniperif.c
356 +++ b/sound/soc/sti/sti_uniperif.c
357 @@ -426,8 +426,10 @@ static int sti_uniperiph_cpu_dai_of(stru
358 UNIPERIF_FIFO_DATA_OFFSET(uni);
359
360 uni->irq = platform_get_irq(priv->pdev, 0);
361 - if (uni->irq < 0)
362 + if (uni->irq < 0) {
363 + dev_err(dev, "Failed to get IRQ resource\n");
364 return -ENXIO;
365 + }
366
367 uni->type = dev_data->type;
368
369 --- a/sound/soc/stm/stm32_i2s.c
370 +++ b/sound/soc/stm/stm32_i2s.c
371 @@ -855,8 +855,11 @@ static int stm32_i2s_parse_dt(struct pla
372
373 /* Get irqs */
374 irq = platform_get_irq(pdev, 0);
375 - if (irq < 0)
376 + if (irq < 0) {
377 + if (irq != -EPROBE_DEFER)
378 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
379 return irq;
380 + }
381
382 ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, IRQF_ONESHOT,
383 dev_name(&pdev->dev), i2s);
384 --- a/sound/soc/stm/stm32_sai.c
385 +++ b/sound/soc/stm/stm32_sai.c
386 @@ -193,8 +193,10 @@ static int stm32_sai_probe(struct platfo
387
388 /* init irqs */
389 sai->irq = platform_get_irq(pdev, 0);
390 - if (sai->irq < 0)
391 + if (sai->irq < 0) {
392 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
393 return sai->irq;
394 + }
395
396 /* reset */
397 rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
398 --- a/sound/soc/stm/stm32_spdifrx.c
399 +++ b/sound/soc/stm/stm32_spdifrx.c
400 @@ -920,8 +920,10 @@ static int stm32_spdifrx_parse_of(struct
401 }
402
403 spdifrx->irq = platform_get_irq(pdev, 0);
404 - if (spdifrx->irq < 0)
405 + if (spdifrx->irq < 0) {
406 + dev_err(&pdev->dev, "No irq for node %s\n", pdev->name);
407 return spdifrx->irq;
408 + }
409
410 return 0;
411 }
412 --- a/sound/soc/sunxi/sun4i-i2s.c
413 +++ b/sound/soc/sunxi/sun4i-i2s.c
414 @@ -1198,8 +1198,10 @@ static int sun4i_i2s_probe(struct platfo
415 return PTR_ERR(regs);
416
417 irq = platform_get_irq(pdev, 0);
418 - if (irq < 0)
419 + if (irq < 0) {
420 + dev_err(&pdev->dev, "Can't retrieve our interrupt\n");
421 return irq;
422 + }
423
424 i2s->variant = of_device_get_match_data(&pdev->dev);
425 if (!i2s->variant) {
426 --- a/sound/soc/uniphier/aio-dma.c
427 +++ b/sound/soc/uniphier/aio-dma.c
428 @@ -289,8 +289,10 @@ int uniphier_aiodma_soc_register_platfor
429 return PTR_ERR(chip->regmap);
430
431 irq = platform_get_irq(pdev, 0);
432 - if (irq < 0)
433 + if (irq < 0) {
434 + dev_err(dev, "Could not get irq.\n");
435 return irq;
436 + }
437
438 ret = devm_request_irq(dev, irq, aiodma_irq,
439 IRQF_SHARED, dev_name(dev), pdev);
440 --- a/sound/soc/xilinx/xlnx_formatter_pcm.c
441 +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c
442 @@ -613,6 +613,7 @@ static int xlnx_formatter_pcm_probe(stru
443 aud_drv_data->mm2s_irq = platform_get_irq_byname(pdev,
444 "irq_mm2s");
445 if (aud_drv_data->mm2s_irq < 0) {
446 + dev_err(dev, "xlnx audio mm2s irq resource failed\n");
447 ret = aud_drv_data->mm2s_irq;
448 goto clk_err;
449 }
450 @@ -639,6 +640,7 @@ static int xlnx_formatter_pcm_probe(stru
451 aud_drv_data->s2mm_irq = platform_get_irq_byname(pdev,
452 "irq_s2mm");
453 if (aud_drv_data->s2mm_irq < 0) {
454 + dev_err(dev, "xlnx audio s2mm irq resource failed\n");
455 ret = aud_drv_data->s2mm_irq;
456 goto clk_err;
457 }
458 --- a/sound/soc/xtensa/xtfpga-i2s.c
459 +++ b/sound/soc/xtensa/xtfpga-i2s.c
460 @@ -570,6 +570,7 @@ static int xtfpga_i2s_probe(struct platf
461
462 irq = platform_get_irq(pdev, 0);
463 if (irq < 0) {
464 + dev_err(&pdev->dev, "No IRQ resource\n");
465 err = irq;
466 goto err;
467 }