summaryrefslogtreecommitdiff
path: root/drivers/usb/typec
diff options
context:
space:
mode:
authorMats Karrman <mats.dev.list@gmail.com>2017-11-24 02:03:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-28 17:08:43 +0300
commitcf140a3569714be6db8f3db56ba68c8554c108c9 (patch)
treea3b3f352664acb590faa31005b9c447c16a622bc /drivers/usb/typec
parent81d8a8eb0a975e151cdbd14f90516a8147d35ee2 (diff)
downloadlinux-cf140a3569714be6db8f3db56ba68c8554c108c9.tar.xz
typec: fusb302: Use dev_err during probe
If probe fails, fusb302_debugfs_exit is called making it impossible to view any logs so use normal dev_err for any error messages during probe. Signed-off-by: Mats Karrman <mats.dev.list@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec')
-rw-r--r--drivers/usb/typec/fusb302/fusb302.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/usb/typec/fusb302/fusb302.c b/drivers/usb/typec/fusb302/fusb302.c
index 72cb060b3fca..4ce1df248c2f 100644
--- a/drivers/usb/typec/fusb302/fusb302.c
+++ b/drivers/usb/typec/fusb302/fusb302.c
@@ -1731,24 +1731,24 @@ static int init_gpio(struct fusb302_chip *chip)
chip->gpio_int_n = of_get_named_gpio(node, "fcs,int_n", 0);
if (!gpio_is_valid(chip->gpio_int_n)) {
ret = chip->gpio_int_n;
- fusb302_log(chip, "cannot get named GPIO Int_N, ret=%d", ret);
+ dev_err(chip->dev, "cannot get named GPIO Int_N, ret=%d", ret);
return ret;
}
ret = devm_gpio_request(chip->dev, chip->gpio_int_n, "fcs,int_n");
if (ret < 0) {
- fusb302_log(chip, "cannot request GPIO Int_N, ret=%d", ret);
+ dev_err(chip->dev, "cannot request GPIO Int_N, ret=%d", ret);
return ret;
}
ret = gpio_direction_input(chip->gpio_int_n);
if (ret < 0) {
- fusb302_log(chip,
- "cannot set GPIO Int_N to input, ret=%d", ret);
+ dev_err(chip->dev,
+ "cannot set GPIO Int_N to input, ret=%d", ret);
return ret;
}
ret = gpio_to_irq(chip->gpio_int_n);
if (ret < 0) {
- fusb302_log(chip,
- "cannot request IRQ for GPIO Int_N, ret=%d", ret);
+ dev_err(chip->dev,
+ "cannot request IRQ for GPIO Int_N, ret=%d", ret);
return ret;
}
chip->gpio_int_n_irq = ret;
@@ -1845,7 +1845,7 @@ static int fusb302_probe(struct i2c_client *client,
chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
if (IS_ERR(chip->tcpm_port)) {
ret = PTR_ERR(chip->tcpm_port);
- fusb302_log(chip, "cannot register tcpm port, ret=%d", ret);
+ dev_err(dev, "cannot register tcpm port, ret=%d", ret);
goto destroy_workqueue;
}
@@ -1854,8 +1854,7 @@ static int fusb302_probe(struct i2c_client *client,
IRQF_ONESHOT | IRQF_TRIGGER_LOW,
"fsc_interrupt_int_n", chip);
if (ret < 0) {
- fusb302_log(chip,
- "cannot request IRQ for GPIO Int_N, ret=%d", ret);
+ dev_err(dev, "cannot request IRQ for GPIO Int_N, ret=%d", ret);
goto tcpm_unregister_port;
}
enable_irq_wake(chip->gpio_int_n_irq);