Skip to contentSkip to conversation

i2c: cht-wc: drop check because i2c_unregister_device() is NULL safe

PATCH Applied Wolfram Sang 3 participants 4 messages Aug 20, 2019 – Sep 4, 2019

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

PATCH 1/1 i2c: cht-wc: drop check because i2c_unregister_device() is NULL safe

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

---
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(-)
drivers/i2c/busses/i2c-cht-wc.c +1 -2
index 66af44bfa67d..3e2608a65c06 100644
@@ -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);
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Wolfram Sang

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

---

Hans, are you OK with this change?

Quoted 24 lines

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(-)
drivers/i2c/busses/i2c-cht-wc.c +1 -2
index 66af44bfa67d..3e2608a65c06 100644
@@ -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);
 
Signature · 1 line
2.20.1
Acked-by
#2 lore raw

Hi,

Quoted 8 lines · Wolfram Sang
Quoted 5 lines · Wolfram Sang

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

---

Hans, are you OK with this change?

Yes this is fine by me:

Regards,

Hans

Quoted 25 lines
Quoted 25 lines

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(-)
drivers/i2c/busses/i2c-cht-wc.c +1 -2
index 66af44bfa67d..3e2608a65c06 100644
@@ -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);
 
Signature · 1 line
2.20.1