Skip to content

Commit cf140a3

Browse files
Mats Karrmangregkh
authored andcommitted
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 <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 81d8a8e commit cf140a3

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

drivers/usb/typec/fusb302/fusb302.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,24 +1731,24 @@ static int init_gpio(struct fusb302_chip *chip)
17311731
chip->gpio_int_n = of_get_named_gpio(node, "fcs,int_n", 0);
17321732
if (!gpio_is_valid(chip->gpio_int_n)) {
17331733
ret = chip->gpio_int_n;
1734-
fusb302_log(chip, "cannot get named GPIO Int_N, ret=%d", ret);
1734+
dev_err(chip->dev, "cannot get named GPIO Int_N, ret=%d", ret);
17351735
return ret;
17361736
}
17371737
ret = devm_gpio_request(chip->dev, chip->gpio_int_n, "fcs,int_n");
17381738
if (ret < 0) {
1739-
fusb302_log(chip, "cannot request GPIO Int_N, ret=%d", ret);
1739+
dev_err(chip->dev, "cannot request GPIO Int_N, ret=%d", ret);
17401740
return ret;
17411741
}
17421742
ret = gpio_direction_input(chip->gpio_int_n);
17431743
if (ret < 0) {
1744-
fusb302_log(chip,
1745-
"cannot set GPIO Int_N to input, ret=%d", ret);
1744+
dev_err(chip->dev,
1745+
"cannot set GPIO Int_N to input, ret=%d", ret);
17461746
return ret;
17471747
}
17481748
ret = gpio_to_irq(chip->gpio_int_n);
17491749
if (ret < 0) {
1750-
fusb302_log(chip,
1751-
"cannot request IRQ for GPIO Int_N, ret=%d", ret);
1750+
dev_err(chip->dev,
1751+
"cannot request IRQ for GPIO Int_N, ret=%d", ret);
17521752
return ret;
17531753
}
17541754
chip->gpio_int_n_irq = ret;
@@ -1845,7 +1845,7 @@ static int fusb302_probe(struct i2c_client *client,
18451845
chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
18461846
if (IS_ERR(chip->tcpm_port)) {
18471847
ret = PTR_ERR(chip->tcpm_port);
1848-
fusb302_log(chip, "cannot register tcpm port, ret=%d", ret);
1848+
dev_err(dev, "cannot register tcpm port, ret=%d", ret);
18491849
goto destroy_workqueue;
18501850
}
18511851

@@ -1854,8 +1854,7 @@ static int fusb302_probe(struct i2c_client *client,
18541854
IRQF_ONESHOT | IRQF_TRIGGER_LOW,
18551855
"fsc_interrupt_int_n", chip);
18561856
if (ret < 0) {
1857-
fusb302_log(chip,
1858-
"cannot request IRQ for GPIO Int_N, ret=%d", ret);
1857+
dev_err(dev, "cannot request IRQ for GPIO Int_N, ret=%d", ret);
18591858
goto tcpm_unregister_port;
18601859
}
18611860
enable_irq_wake(chip->gpio_int_n_irq);

0 commit comments

Comments
 (0)