207c832050ff660e4db7cee1205a4681c26fff1a
[openwrt/staging/hauke.git] /
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 @@ -1196,6 +1196,7 @@ static int pm8916_wcd_analog_spmi_probe(
90
91 irq = platform_get_irq_byname(pdev, "mbhc_switch_int");
92 if (irq < 0) {
93 + dev_err(dev, "failed to get mbhc switch irq\n");
94 ret = irq;
95 goto err_disable_clk;
96 }
97 @@ -1211,6 +1212,7 @@ static int pm8916_wcd_analog_spmi_probe(
98 if (priv->mbhc_btn_enabled) {
99 irq = platform_get_irq_byname(pdev, "mbhc_but_press_det");
100 if (irq < 0) {
101 + dev_err(dev, "failed to get button press irq\n");
102 ret = irq;
103 goto err_disable_clk;
104 }
105 @@ -1225,6 +1227,7 @@ static int pm8916_wcd_analog_spmi_probe(
106
107 irq = platform_get_irq_byname(pdev, "mbhc_but_rel_det");
108 if (irq < 0) {
109 + dev_err(dev, "failed to get button release irq\n");
110 ret = irq;
111 goto err_disable_clk;
112 }
113 --- a/sound/soc/codecs/twl6040.c
114 +++ b/sound/soc/codecs/twl6040.c
115 @@ -1108,8 +1108,10 @@ static int twl6040_probe(struct snd_soc_
116 priv->component = component;
117
118 priv->plug_irq = platform_get_irq(pdev, 0);
119 - if (priv->plug_irq < 0)
120 + if (priv->plug_irq < 0) {
121 + dev_err(component->dev, "invalid irq: %d\n", priv->plug_irq);
122 return priv->plug_irq;
123 + }
124
125 INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work);
126
127 --- a/sound/soc/fsl/fsl_asrc.c
128 +++ b/sound/soc/fsl/fsl_asrc.c
129 @@ -885,8 +885,10 @@ static int fsl_asrc_probe(struct platfor
130 }
131
132 irq = platform_get_irq(pdev, 0);
133 - if (irq < 0)
134 + if (irq < 0) {
135 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
136 return irq;
137 + }
138
139 ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0,
140 dev_name(&pdev->dev), asrc_priv);
141 --- a/sound/soc/fsl/fsl_esai.c
142 +++ b/sound/soc/fsl/fsl_esai.c
143 @@ -979,8 +979,10 @@ static int fsl_esai_probe(struct platfor
144 PTR_ERR(esai_priv->spbaclk));
145
146 irq = platform_get_irq(pdev, 0);
147 - if (irq < 0)
148 + if (irq < 0) {
149 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
150 return irq;
151 + }
152
153 ret = devm_request_irq(&pdev->dev, irq, esai_isr, 0,
154 esai_priv->name, esai_priv);
155 --- a/sound/soc/fsl/fsl_sai.c
156 +++ b/sound/soc/fsl/fsl_sai.c
157 @@ -831,8 +831,10 @@ static int fsl_sai_probe(struct platform
158 }
159
160 irq = platform_get_irq(pdev, 0);
161 - if (irq < 0)
162 + if (irq < 0) {
163 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
164 return irq;
165 + }
166
167 ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
168 if (ret) {
169 --- a/sound/soc/fsl/fsl_spdif.c
170 +++ b/sound/soc/fsl/fsl_spdif.c
171 @@ -1248,8 +1248,10 @@ static int fsl_spdif_probe(struct platfo
172 }
173
174 irq = platform_get_irq(pdev, 0);
175 - if (irq < 0)
176 + if (irq < 0) {
177 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
178 return irq;
179 + }
180
181 ret = devm_request_irq(&pdev->dev, irq, spdif_isr, 0,
182 dev_name(&pdev->dev), spdif_priv);
183 --- a/sound/soc/fsl/fsl_ssi.c
184 +++ b/sound/soc/fsl/fsl_ssi.c
185 @@ -1517,8 +1517,10 @@ static int fsl_ssi_probe(struct platform
186 }
187
188 ssi->irq = platform_get_irq(pdev, 0);
189 - if (ssi->irq < 0)
190 + if (ssi->irq < 0) {
191 + dev_err(dev, "no irq for node %s\n", pdev->name);
192 return ssi->irq;
193 + }
194
195 /* Set software limitations for synchronous mode except AC97 */
196 if (ssi->synchronous && !fsl_ssi_is_ac97(ssi)) {
197 --- a/sound/soc/fsl/imx-ssi.c
198 +++ b/sound/soc/fsl/imx-ssi.c
199 @@ -520,8 +520,10 @@ static int imx_ssi_probe(struct platform
200 }
201
202 ssi->irq = platform_get_irq(pdev, 0);
203 - if (ssi->irq < 0)
204 + if (ssi->irq < 0) {
205 + dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq);
206 return ssi->irq;
207 + }
208
209 ssi->clk = devm_clk_get(&pdev->dev, NULL);
210 if (IS_ERR(ssi->clk)) {
211 --- a/sound/soc/kirkwood/kirkwood-i2s.c
212 +++ b/sound/soc/kirkwood/kirkwood-i2s.c
213 @@ -537,8 +537,10 @@ static int kirkwood_i2s_dev_probe(struct
214 return PTR_ERR(priv->io);
215
216 priv->irq = platform_get_irq(pdev, 0);
217 - if (priv->irq < 0)
218 + if (priv->irq < 0) {
219 + dev_err(&pdev->dev, "platform_get_irq failed: %d\n", priv->irq);
220 return priv->irq;
221 + }
222
223 if (np) {
224 priv->burst = 128; /* might be 32 or 128 */
225 --- a/sound/soc/mediatek/common/mtk-btcvsd.c
226 +++ b/sound/soc/mediatek/common/mtk-btcvsd.c
227 @@ -1333,8 +1333,10 @@ static int mtk_btcvsd_snd_probe(struct p
228
229 /* irq */
230 irq_id = platform_get_irq(pdev, 0);
231 - if (irq_id <= 0)
232 + if (irq_id <= 0) {
233 + dev_err(dev, "%pOFn no irq found\n", dev->of_node);
234 return irq_id < 0 ? irq_id : -ENXIO;
235 + }
236
237 ret = devm_request_irq(dev, irq_id, mtk_btcvsd_snd_irq_handler,
238 IRQF_TRIGGER_LOW, "BTCVSD_ISR_Handle",
239 --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
240 +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
241 @@ -1350,8 +1350,10 @@ static int mt2701_afe_pcm_dev_probe(stru
242 return -ENOMEM;
243
244 irq_id = platform_get_irq_byname(pdev, "asys");
245 - if (irq_id < 0)
246 + if (irq_id < 0) {
247 + dev_err(dev, "unable to get ASYS IRQ\n");
248 return irq_id;
249 + }
250
251 ret = devm_request_irq(dev, irq_id, mt2701_asys_isr,
252 IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
253 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
254 +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
255 @@ -1149,8 +1149,10 @@ static int mt8173_afe_pcm_dev_probe(stru
256 goto err_pm_disable;
257
258 irq_id = platform_get_irq(pdev, 0);
259 - if (irq_id <= 0)
260 + if (irq_id <= 0) {
261 + dev_err(afe->dev, "np %pOFn no irq\n", afe->dev->of_node);
262 return irq_id < 0 ? irq_id : -ENXIO;
263 + }
264 ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
265 0, "Afe_ISR_Handle", (void *)afe);
266 if (ret) {
267 --- a/sound/soc/mxs/mxs-saif.c
268 +++ b/sound/soc/mxs/mxs-saif.c
269 @@ -794,8 +794,12 @@ static int mxs_saif_probe(struct platfor
270 return PTR_ERR(saif->base);
271
272 irq = platform_get_irq(pdev, 0);
273 - if (irq < 0)
274 - return irq;
275 + if (irq < 0) {
276 + ret = irq;
277 + dev_err(&pdev->dev, "failed to get irq resource: %d\n",
278 + ret);
279 + return ret;
280 + }
281
282 saif->dev = &pdev->dev;
283 ret = devm_request_irq(&pdev->dev, irq, mxs_saif_irq, 0,
284 --- a/sound/soc/qcom/lpass-platform.c
285 +++ b/sound/soc/qcom/lpass-platform.c
286 @@ -568,8 +568,11 @@ int asoc_qcom_lpass_platform_register(st
287 int ret;
288
289 drvdata->lpaif_irq = platform_get_irq_byname(pdev, "lpass-irq-lpaif");
290 - if (drvdata->lpaif_irq < 0)
291 + if (drvdata->lpaif_irq < 0) {
292 + dev_err(&pdev->dev, "error getting irq handle: %d\n",
293 + drvdata->lpaif_irq);
294 return -ENODEV;
295 + }
296
297 /* ensure audio hardware is disabled */
298 ret = regmap_write(drvdata->lpaif_map,
299 --- a/sound/soc/sof/intel/bdw.c
300 +++ b/sound/soc/sof/intel/bdw.c
301 @@ -483,8 +483,11 @@ static int bdw_probe(struct snd_sof_dev
302
303 /* register our IRQ */
304 sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
305 - if (sdev->ipc_irq < 0)
306 + if (sdev->ipc_irq < 0) {
307 + dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
308 + desc->irqindex_host_ipc);
309 return sdev->ipc_irq;
310 + }
311
312 dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
313 ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
314 --- a/sound/soc/sof/intel/byt.c
315 +++ b/sound/soc/sof/intel/byt.c
316 @@ -600,8 +600,11 @@ static int byt_acpi_probe(struct snd_sof
317 irq:
318 /* register our IRQ */
319 sdev->ipc_irq = platform_get_irq(pdev, desc->irqindex_host_ipc);
320 - if (sdev->ipc_irq < 0)
321 + if (sdev->ipc_irq < 0) {
322 + dev_err(sdev->dev, "error: failed to get IRQ at index %d\n",
323 + desc->irqindex_host_ipc);
324 return sdev->ipc_irq;
325 + }
326
327 dev_dbg(sdev->dev, "using IRQ %d\n", sdev->ipc_irq);
328 ret = devm_request_threaded_irq(sdev->dev, sdev->ipc_irq,
329 --- a/sound/soc/sprd/sprd-mcdt.c
330 +++ b/sound/soc/sprd/sprd-mcdt.c
331 @@ -959,8 +959,10 @@ static int sprd_mcdt_probe(struct platfo
332 platform_set_drvdata(pdev, mcdt);
333
334 irq = platform_get_irq(pdev, 0);
335 - if (irq < 0)
336 + if (irq < 0) {
337 + dev_err(&pdev->dev, "Failed to get MCDT interrupt\n");
338 return irq;
339 + }
340
341 ret = devm_request_irq(&pdev->dev, irq, sprd_mcdt_irq_handler,
342 0, "sprd-mcdt", mcdt);
343 --- a/sound/soc/sti/sti_uniperif.c
344 +++ b/sound/soc/sti/sti_uniperif.c
345 @@ -426,8 +426,10 @@ static int sti_uniperiph_cpu_dai_of(stru
346 UNIPERIF_FIFO_DATA_OFFSET(uni);
347
348 uni->irq = platform_get_irq(priv->pdev, 0);
349 - if (uni->irq < 0)
350 + if (uni->irq < 0) {
351 + dev_err(dev, "Failed to get IRQ resource\n");
352 return -ENXIO;
353 + }
354
355 uni->type = dev_data->type;
356
357 --- a/sound/soc/stm/stm32_i2s.c
358 +++ b/sound/soc/stm/stm32_i2s.c
359 @@ -855,8 +855,11 @@ static int stm32_i2s_parse_dt(struct pla
360
361 /* Get irqs */
362 irq = platform_get_irq(pdev, 0);
363 - if (irq < 0)
364 + if (irq < 0) {
365 + if (irq != -EPROBE_DEFER)
366 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
367 return irq;
368 + }
369
370 ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, IRQF_ONESHOT,
371 dev_name(&pdev->dev), i2s);
372 --- a/sound/soc/stm/stm32_sai.c
373 +++ b/sound/soc/stm/stm32_sai.c
374 @@ -193,8 +193,10 @@ static int stm32_sai_probe(struct platfo
375
376 /* init irqs */
377 sai->irq = platform_get_irq(pdev, 0);
378 - if (sai->irq < 0)
379 + if (sai->irq < 0) {
380 + dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
381 return sai->irq;
382 + }
383
384 /* reset */
385 rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
386 --- a/sound/soc/stm/stm32_spdifrx.c
387 +++ b/sound/soc/stm/stm32_spdifrx.c
388 @@ -920,8 +920,10 @@ static int stm32_spdifrx_parse_of(struct
389 }
390
391 spdifrx->irq = platform_get_irq(pdev, 0);
392 - if (spdifrx->irq < 0)
393 + if (spdifrx->irq < 0) {
394 + dev_err(&pdev->dev, "No irq for node %s\n", pdev->name);
395 return spdifrx->irq;
396 + }
397
398 return 0;
399 }
400 --- a/sound/soc/sunxi/sun4i-i2s.c
401 +++ b/sound/soc/sunxi/sun4i-i2s.c
402 @@ -1198,8 +1198,10 @@ static int sun4i_i2s_probe(struct platfo
403 return PTR_ERR(regs);
404
405 irq = platform_get_irq(pdev, 0);
406 - if (irq < 0)
407 + if (irq < 0) {
408 + dev_err(&pdev->dev, "Can't retrieve our interrupt\n");
409 return irq;
410 + }
411
412 i2s->variant = of_device_get_match_data(&pdev->dev);
413 if (!i2s->variant) {
414 --- a/sound/soc/uniphier/aio-dma.c
415 +++ b/sound/soc/uniphier/aio-dma.c
416 @@ -289,8 +289,10 @@ int uniphier_aiodma_soc_register_platfor
417 return PTR_ERR(chip->regmap);
418
419 irq = platform_get_irq(pdev, 0);
420 - if (irq < 0)
421 + if (irq < 0) {
422 + dev_err(dev, "Could not get irq.\n");
423 return irq;
424 + }
425
426 ret = devm_request_irq(dev, irq, aiodma_irq,
427 IRQF_SHARED, dev_name(dev), pdev);
428 --- a/sound/soc/xilinx/xlnx_formatter_pcm.c
429 +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c
430 @@ -634,6 +634,7 @@ static int xlnx_formatter_pcm_probe(stru
431 aud_drv_data->mm2s_irq = platform_get_irq_byname(pdev,
432 "irq_mm2s");
433 if (aud_drv_data->mm2s_irq < 0) {
434 + dev_err(dev, "xlnx audio mm2s irq resource failed\n");
435 ret = aud_drv_data->mm2s_irq;
436 goto clk_err;
437 }
438 @@ -660,6 +661,7 @@ static int xlnx_formatter_pcm_probe(stru
439 aud_drv_data->s2mm_irq = platform_get_irq_byname(pdev,
440 "irq_s2mm");
441 if (aud_drv_data->s2mm_irq < 0) {
442 + dev_err(dev, "xlnx audio s2mm irq resource failed\n");
443 ret = aud_drv_data->s2mm_irq;
444 goto clk_err;
445 }
446 --- a/sound/soc/xtensa/xtfpga-i2s.c
447 +++ b/sound/soc/xtensa/xtfpga-i2s.c
448 @@ -570,6 +570,7 @@ static int xtfpga_i2s_probe(struct platf
449
450 irq = platform_get_irq(pdev, 0);
451 if (irq < 0) {
452 + dev_err(&pdev->dev, "No IRQ resource\n");
453 err = irq;
454 goto err;
455 }