public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: cht-wc: drop check because i2c_unregister_device() is NULL safe
@ 2019-08-20 15:34 Wolfram Sang
  2019-09-03 17:52 ` Wolfram Sang
  2019-09-04 21:12 ` Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfram Sang @ 2019-08-20 15:34 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Hans de Goede, linux-kernel

No need to check the argument of i2c_unregister_device() because the
function itself does it.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Build tested only, buildbot is happy, too.

Please apply to your tree.

 drivers/i2c/busses/i2c-cht-wc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c
index 66af44bfa67d..3e2608a65c06 100644
--- a/drivers/i2c/busses/i2c-cht-wc.c
+++ b/drivers/i2c/busses/i2c-cht-wc.c
@@ -363,8 +363,7 @@ static int cht_wc_i2c_adap_i2c_remove(struct platform_device *pdev)
 {
 	struct cht_wc_i2c_adap *adap = platform_get_drvdata(pdev);
 
-	if (adap->client)
-		i2c_unregister_device(adap->client);
+	i2c_unregister_device(adap->client);
 	i2c_del_adapter(&adap->adapter);
 	irq_domain_remove(adap->irq_domain);
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-04 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-20 15:34 [PATCH] i2c: cht-wc: drop check because i2c_unregister_device() is NULL safe Wolfram Sang
2019-09-03 17:52 ` Wolfram Sang
2019-09-04  8:26   ` Hans de Goede
2019-09-04 21:12 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox