summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2023-07-25 15:28:09 +0300
committerDamien Le Moal <dlemoal@kernel.org>2023-07-26 02:32:21 +0300
commit1cfe2d28e4d50a4e3e49344ade3b28f8dc26f891 (patch)
treec6c4e0be8db4fd55b82817d73105c77e195ea952 /drivers/ata
parent4139f992c49356391fb086c0c8ce51f66c26d623 (diff)
downloadlinux-1cfe2d28e4d50a4e3e49344ade3b28f8dc26f891.tar.xz
ata: pata_octeon_cf: fix error return code in octeon_cf_probe()
The variable 'rv' is set to 0 after calling of_property_read_reg(), so it cannot be used as an error code. Change to using correct error codes in the error path. Fixes: d0b2461678b1 ("ata: Use of_property_read_reg() to parse "reg"") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_octeon_cf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index ff538b858928..2884acfc4863 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -815,8 +815,8 @@ static int octeon_cf_probe(struct platform_device *pdev)
irq_handler_t irq_handler = NULL;
void __iomem *base;
struct octeon_cf_port *cf_port;
- int rv = -ENOMEM;
u32 bus_width;
+ int rv;
node = pdev->dev.of_node;
if (node == NULL)
@@ -893,12 +893,12 @@ static int octeon_cf_probe(struct platform_device *pdev)
cs0 = devm_ioremap(&pdev->dev, res_cs0->start,
resource_size(res_cs0));
if (!cs0)
- return rv;
+ return -ENOMEM;
/* allocate host */
host = ata_host_alloc(&pdev->dev, 1);
if (!host)
- return rv;
+ return -ENOMEM;
ap = host->ports[0];
ap->private_data = cf_port;