Skip to content

Commit

Permalink
i2c: Remove unnecessary call to irq_find_mapping
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Charles Keepax authored and Wolfram Sang committed Oct 31, 2018
1 parent 9bb9d4f commit b9bb3fd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/i2c/i2c-core-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b9bb3fd

Please sign in to comment.