Skip to content
Snippets Groups Projects
Commit 73864f63 authored by Sebastian Reichel's avatar Sebastian Reichel Committed by Sebastian Reichel
Browse files

usb: typec: tcpci: Improve error printing during probe


It's currently quite hard to understand why a tcpci controller
probe might run into probe defer. Let's improve that by adding
some error messages.

Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 5303eab6
Branches
No related tags found
No related merge requests found
Pipeline #134030 passed
...@@ -919,24 +919,25 @@ static int tcpci_probe(struct i2c_client *client) ...@@ -919,24 +919,25 @@ static int tcpci_probe(struct i2c_client *client)
err = regmap_raw_write(chip->data.regmap, TCPC_ALERT_MASK, &val, err = regmap_raw_write(chip->data.regmap, TCPC_ALERT_MASK, &val,
sizeof(u16)); sizeof(u16));
if (err < 0) if (err < 0)
return err; return dev_err_probe(&client->dev, err, "failed to disable IRQs\n");
err = tcpci_check_std_output_cap(chip->data.regmap, err = tcpci_check_std_output_cap(chip->data.regmap,
TCPC_STD_OUTPUT_CAP_ORIENTATION); TCPC_STD_OUTPUT_CAP_ORIENTATION);
if (err < 0) if (err < 0)
return err; return dev_err_probe(&client->dev, err, "failed to check output capability\n");
chip->data.set_orientation = err; chip->data.set_orientation = err;
chip->tcpci = tcpci_register_port(&client->dev, &chip->data); chip->tcpci = tcpci_register_port(&client->dev, &chip->data);
if (IS_ERR(chip->tcpci)) if (IS_ERR(chip->tcpci))
return PTR_ERR(chip->tcpci); return dev_err_probe(&client->dev, PTR_ERR(chip->tcpci), "failed to register tcpci port\n");
err = devm_request_threaded_irq(&client->dev, client->irq, NULL, err = devm_request_threaded_irq(&client->dev, client->irq, NULL,
_tcpci_irq, _tcpci_irq,
IRQF_SHARED | IRQF_ONESHOT, IRQF_SHARED | IRQF_ONESHOT,
dev_name(&client->dev), chip); dev_name(&client->dev), chip);
if (err < 0) if (err < 0)
dev_err_probe(&client->dev, err, "failed to request irq\n");
goto unregister_port; goto unregister_port;
/* Enable chip interrupts at last */ /* Enable chip interrupts at last */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment