From ee8fae723646ed7644c8eca0f91fb104a0885c19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Thu, 24 Oct 2013 09:57:09 +0200 Subject: [PATCH] ahci_platform: fix error return values in ahci_probe() function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - 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 --- drivers/ata/ahci_platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index f9554318504f..d3d12be88f96 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -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) -- 2.39.2