2013-06-07 02:16:57

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH] pcmcia: pd6729: fix error return code in pd6729_pci_probe()

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/pcmcia/pd6729.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index b29d97e..a4c16ee 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -644,6 +644,7 @@ static int pd6729_pci_probe(struct pci_dev *dev,
if (!pci_resource_start(dev, 0)) {
dev_warn(&dev->dev, "refusing to load the driver as the "
"io_base is NULL.\n");
+ ret = -ENOMEM;
goto err_out_disable;
}

@@ -673,6 +674,7 @@ static int pd6729_pci_probe(struct pci_dev *dev,
mask = pd6729_isa_scan();
if (irq_mode == 0 && mask == 0) {
dev_warn(&dev->dev, "no ISA interrupt is available.\n");
+ ret = -ENODEV;
goto err_out_free_res;
}


2013-06-09 16:09:02

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] pcmcia: pd6729: fix error return code in pd6729_pci_probe()

On Fri, Jun 7, 2013 at 5:16 AM, Wei Yongjun <[email protected]> wrote:
> From: Wei Yongjun <[email protected]>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

What about to move the driver to pcim_*/devm_* functions?

--
With Best Regards,
Andy Shevchenko