]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ahci_platform: fix error return values in ahci_probe() function
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 24 Oct 2013 07:57:09 +0000 (09:57 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 5 Nov 2013 21:43:30 +0000 (22:43 +0100)
- ENODEV is more appropriate than EINVAL if platform_get_resource() fails
- promote the return value from platform_get_irq() rather than inventing
  a new one

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
drivers/ata/ahci_platform.c

index f9554318504f8a401c97b2221831b1cdbdcdb67f..d3d12be88f96712de71bbf304539e99448a52e3f 100644 (file)
@@ -105,13 +105,13 @@ static int ahci_probe(struct platform_device *pdev)
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!mem) {
                dev_err(dev, "no mmio space\n");
-               return -EINVAL;
+               return -ENODEV;
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
+       if (irq < 0) {
                dev_err(dev, "no irq\n");
-               return -EINVAL;
+               return irq;
        }
 
        if (pdata && pdata->ata_port_info)