Commit 68a1c848 authored by Fabien Dessenne's avatar Fabien Dessenne Committed by Jassi Brar

mailbox: stm32-ipcc: check invalid irq

On failure of_irq_get() returns a negative value or zero, which is
not handled as an error in the existing implementation.
Instead of using this API, use platform_get_irq() that returns
exclusively a negative value on failure.
Also, do not output an error log in case of defer probe error.
Signed-off-by: default avatarFabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 0c40e631
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_wakeirq.h> #include <linux/pm_wakeirq.h>
...@@ -240,9 +240,11 @@ static int stm32_ipcc_probe(struct platform_device *pdev) ...@@ -240,9 +240,11 @@ static int stm32_ipcc_probe(struct platform_device *pdev)
/* irq */ /* irq */
for (i = 0; i < IPCC_IRQ_NUM; i++) { for (i = 0; i < IPCC_IRQ_NUM; i++) {
ipcc->irqs[i] = of_irq_get_byname(dev->of_node, irq_name[i]); ipcc->irqs[i] = platform_get_irq_byname(pdev, irq_name[i]);
if (ipcc->irqs[i] < 0) { if (ipcc->irqs[i] < 0) {
dev_err(dev, "no IRQ specified %s\n", irq_name[i]); if (ipcc->irqs[i] != -EPROBE_DEFER)
dev_err(dev, "no IRQ specified %s\n",
irq_name[i]);
ret = ipcc->irqs[i]; ret = ipcc->irqs[i];
goto err_clk; goto err_clk;
} }
...@@ -263,8 +265,9 @@ static int stm32_ipcc_probe(struct platform_device *pdev) ...@@ -263,8 +265,9 @@ static int stm32_ipcc_probe(struct platform_device *pdev)
/* wakeup */ /* wakeup */
if (of_property_read_bool(np, "wakeup-source")) { if (of_property_read_bool(np, "wakeup-source")) {
ipcc->wkp = of_irq_get_byname(dev->of_node, "wakeup"); ipcc->wkp = platform_get_irq_byname(pdev, "wakeup");
if (ipcc->wkp < 0) { if (ipcc->wkp < 0) {
if (ipcc->wkp != -EPROBE_DEFER)
dev_err(dev, "could not get wakeup IRQ\n"); dev_err(dev, "could not get wakeup IRQ\n");
ret = ipcc->wkp; ret = ipcc->wkp;
goto err_clk; goto err_clk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment