801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch 14 KB

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