Commit 1cfe2d28 authored by Yang Yingliang's avatar Yang Yingliang Committed by Damien Le Moal

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: d0b24616 ("ata: Use of_property_read_reg() to parse "reg"")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
parent 4139f992
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment