* [PATCH] mfd: db8500-prcmu: Provide sane error path values
@ 2014-11-03 16:15 Lee Jones
2014-11-03 16:35 ` Fabio Estevam
0 siblings, 1 reply; 4+ messages in thread
From: Lee Jones @ 2014-11-03 16:15 UTC (permalink / raw)
To: linux-arm-kernel
Also rid superfluous gotos and label.
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/db8500-prcmu.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 89ae8bf..a820473 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -3150,27 +3150,27 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu");
if (!res) {
dev_err(&pdev->dev, "no prcmu memory region provided\n");
- return -ENOENT;
+ return -EINVAL;
}
prcmu_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (!prcmu_base) {
dev_err(&pdev->dev,
"failed to ioremap prcmu register memory\n");
- return -ENOENT;
+ return -ENOMEM;
}
init_prcm_registers();
dbx500_fw_version_init(pdev, pdata->version_offset);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcdm");
if (!res) {
dev_err(&pdev->dev, "no prcmu tcdm region provided\n");
- return -ENOENT;
+ return -EINVAL;
}
tcdm_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (!tcdm_base) {
dev_err(&pdev->dev,
"failed to ioremap prcmu-tcdm register memory\n");
- return -ENOENT;
+ return -ENOMEM;
}
/* Clean up the mailbox interrupts after pre-kernel code. */
@@ -3179,15 +3179,14 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(&pdev->dev, "no prcmu irq provided\n");
- return -ENOENT;
+ return irq;
}
err = request_threaded_irq(irq, prcmu_irq_handler,
prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);
if (err < 0) {
pr_err("prcmu: Failed to allocate IRQ_DB8500_PRCMU1.\n");
- err = -EBUSY;
- goto no_irq_return;
+ return err;
}
db8500_irq_init(np);
@@ -3211,7 +3210,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
if (err) {
mfd_remove_devices(&pdev->dev);
pr_err("prcmu: Failed to add subdevices\n");
- goto no_irq_return;
+ return err;
}
}
@@ -3219,12 +3218,10 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
if (err) {
mfd_remove_devices(&pdev->dev);
pr_err("prcmu: Failed to add ab8500 subdevice\n");
- goto no_irq_return;
+ return err;
}
pr_info("DB8500 PRCMU initialized\n");
-
-no_irq_return:
return err;
}
static const struct of_device_id db8500_prcmu_match[] = {
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] mfd: db8500-prcmu: Provide sane error path values
2014-11-03 16:15 [PATCH] mfd: db8500-prcmu: Provide sane error path values Lee Jones
@ 2014-11-03 16:35 ` Fabio Estevam
2014-11-03 16:50 ` Lee Jones
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2014-11-03 16:35 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 3, 2014 at 2:15 PM, Lee Jones <lee.jones@linaro.org> wrote:
> /* Clean up the mailbox interrupts after pre-kernel code. */
> @@ -3179,15 +3179,14 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
> irq = platform_get_irq(pdev, 0);
> if (irq <= 0) {
Shouldn't this be if (irq < 0) then?
> dev_err(&pdev->dev, "no prcmu irq provided\n");
> - return -ENOENT;
> + return irq;
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] mfd: db8500-prcmu: Provide sane error path values
2014-11-03 16:35 ` Fabio Estevam
@ 2014-11-03 16:50 ` Lee Jones
2014-11-04 10:13 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Lee Jones @ 2014-11-03 16:50 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 03 Nov 2014, Fabio Estevam wrote:
> On Mon, Nov 3, 2014 at 2:15 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
> > /* Clean up the mailbox interrupts after pre-kernel code. */
> > @@ -3179,15 +3179,14 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
> > irq = platform_get_irq(pdev, 0);
> > if (irq <= 0) {
>
> Shouldn't this be if (irq < 0) then?
Perhaps Linus can answer that.
Linus,
Is 0 a valid IRQ on the u8500 platform or not?
> > dev_err(&pdev->dev, "no prcmu irq provided\n");
> > - return -ENOENT;
> > + return irq;
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] mfd: db8500-prcmu: Provide sane error path values
2014-11-03 16:50 ` Lee Jones
@ 2014-11-04 10:13 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-11-04 10:13 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 3, 2014 at 5:50 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 03 Nov 2014, Fabio Estevam wrote:
>
>> On Mon, Nov 3, 2014 at 2:15 PM, Lee Jones <lee.jones@linaro.org> wrote:
>>
>> > /* Clean up the mailbox interrupts after pre-kernel code. */
>> > @@ -3179,15 +3179,14 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
>> > irq = platform_get_irq(pdev, 0);
>> > if (irq <= 0) {
>>
>> Shouldn't this be if (irq < 0) then?
>
> Perhaps Linus can answer that.
>
> Linus,
>
> Is 0 a valid IRQ on the u8500 platform or not?
It is not. 0 is NO_IRQ and should be so for every system... just
the lazy and ancient ones lag behind.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-11-04 10:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 16:15 [PATCH] mfd: db8500-prcmu: Provide sane error path values Lee Jones
2014-11-03 16:35 ` Fabio Estevam
2014-11-03 16:50 ` Lee Jones
2014-11-04 10:13 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).