mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
usb: typec: tipd: Use read_power_status function in probe
We need the initial power status to be able to reliably detect connector changes once we introduce de-bouncing for CD321x next. read_power_status takes care of this and also forwards the status to the trace subsystem so let's use that instead of open-coding it inside probe. Signed-off-by: Hector Martin <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Neal Gompa <[email protected]> Signed-off-by: Sven Peter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
36c791c199
commit
77ed2f4538
@@ -1549,11 +1549,8 @@ static int tps6598x_probe(struct i2c_client *client)
|
||||
goto err_role_put;
|
||||
|
||||
if (status & TPS_STATUS_PLUG_PRESENT) {
|
||||
ret = tps6598x_read16(tps, TPS_REG_POWER_STATUS, &tps->pwr_status);
|
||||
if (ret < 0) {
|
||||
dev_err(tps->dev, "failed to read power status: %d\n", ret);
|
||||
if (!tps6598x_read_power_status(tps))
|
||||
goto err_unregister_port;
|
||||
}
|
||||
ret = tps6598x_connect(tps, status);
|
||||
if (ret)
|
||||
dev_err(&client->dev, "failed to register partner\n");
|
||||
|
||||
Reference in New Issue
Block a user