LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] i2c: Remove unnecessary call to irq_find_mapping
@ 2018-10-19  8:59 Charles Keepax
  2018-10-19  8:59 ` [PATCH 2/2] i2c: Clear client->irq in i2c_device_remove Charles Keepax
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Charles Keepax @ 2018-10-19  8:59 UTC (permalink / raw)
  To: wsa; +Cc: linux-i2c, linux-kernel, patches

irq_create_mapping calls irq_find_mapping internally and will use the
found mapping if one exists, so there is no need to manually call this
from i2c_smbus_host_notify_to_irq.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 drivers/i2c/i2c-core-base.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index dc78aa7369def..656f0a6fe3adf 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -306,10 +306,7 @@ static int i2c_smbus_host_notify_to_irq(const struct i2c_client *client)
 	if (client->flags & I2C_CLIENT_TEN)
 		return -EINVAL;
 
-	irq = irq_find_mapping(adap->host_notify_domain, client->addr);
-	if (!irq)
-		irq = irq_create_mapping(adap->host_notify_domain,
-					 client->addr);
+	irq = irq_create_mapping(adap->host_notify_domain, client->addr);
 
 	return irq > 0 ? irq : -ENXIO;
 }
-- 
2.11.0


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

end of thread, other threads:[~2019-01-10 20:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-19  8:59 [PATCH 1/2] i2c: Remove unnecessary call to irq_find_mapping Charles Keepax
2018-10-19  8:59 ` [PATCH 2/2] i2c: Clear client->irq in i2c_device_remove Charles Keepax
2018-10-28 22:31   ` Wolfram Sang
2018-10-29 10:15     ` Benjamin Tissoires
2018-10-30 11:51       ` Charles Keepax
2018-10-30 14:34         ` Benjamin Tissoires
2018-10-30 14:55           ` Wolfram Sang
2018-10-31  9:52             ` Charles Keepax
2018-10-31  9:59               ` Wolfram Sang
2018-10-31 23:35   ` Wolfram Sang
2019-01-09 21:47   ` Yauhen Kharuzhy
2019-01-10 13:32     ` Charles Keepax
2019-01-10 20:35       ` Yauhen Kharuzhy
2018-10-28 22:30 ` [PATCH 1/2] i2c: Remove unnecessary call to irq_find_mapping Wolfram Sang
2018-10-29 10:13   ` Benjamin Tissoires
2018-10-31 23:34 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).