Skip to contentSkip to conversation

i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove()

PATCH Applied Dan Carpenter 3 participants 3 messages Mar 28, 2019 – Apr 3, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/i2c/busses/i2c-nomadik.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/i2c/busses/i2c-nomadik.c +1 -2
index 0ed5a41804dc..4f30a43b63da 100644
@@ -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;
 }
Signature · 1 line
2.17.1