i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 28 Mar 2019 14:16:09 +0000 (17:16 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 3 Apr 2019 20:49:31 +0000 (22:49 +0200)
"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>
drivers/i2c/busses/i2c-nomadik.c

index 0ed5a41804dcf8d5d33d043a3d0f8e29b5430e4f..4f30a43b63da27aab5a3ef7e6d60dc8f9054ec59 100644 (file)
@@ -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;
 }