]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
i2c: Remove unnecessary call to irq_find_mapping
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 19 Oct 2018 08:59:57 +0000 (09:59 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838459
commit b9bb3fdf4e870fb655064f5c3c81c1fee7fd89ce upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/i2c/i2c-core-base.c

index b608834c748675191949a379659161f317506ddd..bcb5db76d5cfd52a48f75ce02713b6857af23bd3 100644 (file)
@@ -316,10 +316,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;
 }