LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <wsa@the-dreams.de>
Cc: <linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<patches@opensource.cirrus.com>
Subject: [PATCH 1/2] i2c: Remove unnecessary call to irq_find_mapping
Date: Fri, 19 Oct 2018 09:59:57 +0100	[thread overview]
Message-ID: <20181019085958.32694-1-ckeepax@opensource.cirrus.com> (raw)

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


             reply	other threads:[~2018-10-19  9:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19  8:59 Charles Keepax [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181019085958.32694-1-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=wsa@the-dreams.de \
    --subject='Re: [PATCH 1/2] i2c: Remove unnecessary call to irq_find_mapping' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).