summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-03-28 15:16:09 +0100
committerWolfram Sang <wsa@the-dreams.de>2019-04-03 22:49:31 +0200
commitd469127528ec48437a010620c22f2443053003c1 (patch)
tree340d79924361fffd79a571e448a62c12d5940917 /drivers/i2c
parenti2c: iproc: add NIC I2C support (diff)
downloadlinux-d469127528ec48437a010620c22f2443053003c1.tar.xz
linux-d469127528ec48437a010620c22f2443053003c1.zip
i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove()
"res" can't be NULL because it's a pointer to somewhere in the middle of the "adev" struct. Also probe() succeeded so there is no need to check here. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-nomadik.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 0ed5a41804dc..4f30a43b63da 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -1070,8 +1070,7 @@ static int nmk_i2c_remove(struct amba_device *adev)
/* disable the controller */
i2c_clr_bit(dev->virtbase + I2C_CR, I2C_CR_PE);
clk_disable_unprepare(dev->clk);
- if (res)
- release_mem_region(res->start, resource_size(res));
+ release_mem_region(res->start, resource_size(res));
return 0;
}