staging: xillybus: Return -EIO if *_iomap fails, instead of 0
authorEli Billauer <eli.billauer@gmail.com>
Tue, 17 Dec 2013 19:36:29 +0000 (21:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2013 01:07:13 +0000 (17:07 -0800)
This patch replicates the correction made by Wei Yongjun on a second
occurrence of the same bug.

The first correction was in commit 8eec4555511bfa1f8a2e0a2de45c988fd30c3efb.

Bug fixed: The error code was not set, so the error condition wasn't reflected
in the return value.

Reported-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xillybus/xillybus_of.c

index 394bfea1af6e308d0118e75adc16d25bc0dc801d..3b25b0e100b400a5bb85398120fbdc71165d7451 100644 (file)
@@ -131,10 +131,10 @@ static int xilly_drv_probe(struct platform_device *op)
        }
 
        endpoint->registers = of_iomap(dev->of_node, 0);
-
        if (!endpoint->registers) {
                dev_err(endpoint->dev,
                        "Failed to map I/O memory. Aborting.\n");
+               rc = -EIO;
                goto failed_iomap0;
        }