From: Dan Carpenter Date: Thu, 28 Mar 2019 14:16:09 +0000 (+0300) Subject: i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove() X-Git-Tag: v5.4-rc1~1029^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d469127528ec48437a010620c22f2443053003c1;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Linus Walleij Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 0ed5a41..4f30a43 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; }