summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-02-25 14:37:40 +0300
committerMark Brown <broonie@kernel.org>2016-02-26 05:06:38 +0300
commit14a20428e2e02600195a71ad366c0caef97bf3d4 (patch)
treeb6826679ced4fb7e1da3332f2fdf00261f62c3dd /drivers/spi
parent7ecbfff6711fb331591003ac32c002ce55a0758f (diff)
downloadlinux-14a20428e2e02600195a71ad366c0caef97bf3d4.tar.xz
spi: lp-8841: return correct error code from probe
The spi_lp8841_rtc_probe() function misses an initialization of the return code when it fails to get its memory resource, as gcc notices: drivers/spi/spi-lp8841-rtc.c: In function 'spi_lp8841_rtc_probe': drivers/spi/spi-lp8841-rtc.c:239:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] This changes the code to propagate the error from devm_ioremap_resource(). Fixes: 7ecbfff6711f ("spi: master driver to enable RTC on ICPDAS LP-8841") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Sergei Ianovich <ynvich@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-lp8841-rtc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi-lp8841-rtc.c b/drivers/spi/spi-lp8841-rtc.c
index 44bb69c3f1d6..faa577d282c0 100644
--- a/drivers/spi/spi-lp8841-rtc.c
+++ b/drivers/spi/spi-lp8841-rtc.c
@@ -217,8 +217,9 @@ spi_lp8841_rtc_probe(struct platform_device *pdev)
data = spi_master_get_devdata(master);
iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- data->iomem = devm_ioremap_resource(&pdev->dev, iomem);
- if (IS_ERR(data->iomem)) {
+ data->iomem = devm_ioremap_resource(&pdev->dev, iomem);
+ ret = PTR_ERR_OR_ZERO(data->iomem);
+ if (ret) {
dev_err(&pdev->dev, "failed to get IO address\n");
goto err_put_master;
}