From: Hector Martin Date: Sun, 14 Sep 2025 12:56:14 +0000 (+0000) Subject: usb: typec: tipd: Use read_power_status function in probe X-Git-Tag: v6.18-rc1~76^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77ed2f4538da7356a1813e9d4e4c13de6e3d5a2a;p=thirdparty%2Fkernel%2Fstable.git 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 Reviewed-by: Heikki Krogerus Reviewed-by: Neal Gompa Signed-off-by: Sven Peter Link: https://lore.kernel.org/r/20250914-apple-usb3-tipd-v1-9-4e99c8649024@kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index e16c6c07c72a3..f546f4ae563af 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -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");