diff options
author | Hans de Goede <hdegoede@redhat.com> | 2017-08-30 05:48:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-31 12:23:12 -0400 |
commit | 4660e4aeb9d74895eb6478932bf5cabeb0db723e (patch) | |
tree | f065792a0eb572f5364023483513c16bf8635ce8 | |
parent | 097578ec200858cfa2dd905b08ab8d5576a656e6 (diff) |
staging: typec: fusb302: Use client->irq as irq if set
The fusb302 is also used on x86 systems where the platform code sets
the irq in client->irq and there is no gpio named fcs,int_n.
Cc: "Yueyao (Nathan) Zhu" <yueyao@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/typec/fusb302/fusb302.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c index 1c1751c994db..675161cf4f3a 100644 --- a/drivers/staging/typec/fusb302/fusb302.c +++ b/drivers/staging/typec/fusb302/fusb302.c | |||
@@ -1735,9 +1735,13 @@ static int fusb302_probe(struct i2c_client *client, | |||
1735 | goto destroy_workqueue; | 1735 | goto destroy_workqueue; |
1736 | } | 1736 | } |
1737 | 1737 | ||
1738 | ret = init_gpio(chip); | 1738 | if (client->irq) { |
1739 | if (ret < 0) | 1739 | chip->gpio_int_n_irq = client->irq; |
1740 | goto destroy_workqueue; | 1740 | } else { |
1741 | ret = init_gpio(chip); | ||
1742 | if (ret < 0) | ||
1743 | goto destroy_workqueue; | ||
1744 | } | ||
1741 | 1745 | ||
1742 | chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev); | 1746 | chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev); |
1743 | if (IS_ERR(chip->tcpm_port)) { | 1747 | if (IS_ERR(chip->tcpm_port)) { |