From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B649BCA0EFA for ; Thu, 21 Aug 2025 19:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MVya7U1pNpeurPiseeSXOo7ACTsbQ3llPjtewCU2dBM=; b=x8ZNC+W/74Ukse 1Cw/g/1OUWwHUQVNmW0uRT8bb3g5VBf9zKYWS5GOiyjRI7bAT4upFRivyK2oeIIzmkwkxDV5SBSUI LYjRGmrXwvwYs4hUt/SiWGLLgp8EU7QZeo51VIkOc/Ue0rO0Z1LHk55p93ll6fVqCc6bH5LnnZ1lP VYiYkmzVnJPoTmSRzpV5wcEg+o8si3xqMZyie3bHEarnBknEoUxc/3xMzAfQRXnxJzY8ZCZmW6Ls0 HmzmI5hiXDNIYhmvCKxUxzELRR6Xd6OsWw9tHAERRpJtp5Dv9RepPKeGY2M1WQSNPwHKD66fyEVwQ E5M6HB1cPx/lJJ3hG+cQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1upBMI-00000000LuN-20BE; Thu, 21 Aug 2025 19:54:02 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1up7OX-0000000HQYj-1Hwp; Thu, 21 Aug 2025 15:40:08 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 9892C41934; Thu, 21 Aug 2025 15:40:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 03347C2BCC9; Thu, 21 Aug 2025 15:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755790804; bh=JpvVGxBU6VJFwCo6sQ3bdFMMfZ4sHXsnoW4iOc433dI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=L9FJ8fMIWsSov5P/KMDu/sSBGHrs73BU2rqNdh201zQwpXEeViQy3Zn8IkLlzLePC 4AJVwr1n0SSiEDbjb48J3nO3tERpBpyN7P6IAmBeIVTleNLozYjzryJEgbY6wkGVnu bhbZWPAcfENsc4H0zoMqxN1Ktc8kC2lT16VRIHqTpx00MMjAdk0wbQ7bPXf4j6PFds Ew/CfVxYz/+uR/Zo2dRmAavx2GhMUmSl8EINYObR4fmRnSBRzNLyqgLV++kbuzlbf5 u1PgHizmxUk1MOtKdDkD8+/L6tuVAlsxX7K0YlyuOCqGFRng7Pc6lUk/F2J3Q2y7tN YaACKAlSg3OkA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6EE8CA0FE8; Thu, 21 Aug 2025 15:40:03 +0000 (UTC) From: Sven Peter Date: Thu, 21 Aug 2025 15:39:08 +0000 Subject: [PATCH RFC 16/22] usb: typec: tipd: Use read_power_status function in probe MIME-Version: 1.0 Message-Id: <20250821-atcphy-6-17-v1-16-172beda182b8@kernel.org> References: <20250821-atcphy-6-17-v1-0-172beda182b8@kernel.org> In-Reply-To: <20250821-atcphy-6-17-v1-0-172beda182b8@kernel.org> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Vinod Koul , Kishon Vijay Abraham I , Thinh Nguyen , Heikki Krogerus , Philipp Zabel Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, Sven Peter , Hector Martin X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1231; i=sven@kernel.org; h=from:subject:message-id; bh=y56aSt+8+GGBv7M4CTBesZmBIVzkBqBitGUe5JAi5T0=; b=owGbwMvMwCHmIlirolUq95LxtFoSQ8Zy2237661DTmzwOHm3mbPDcmX2qgs3eK6999ObE5S38 /LNpg8xHaUsDGIcDLJiiizb99ubPnn4RnDppkvvYeawMoEMYeDiFICJOGQyMlyaPP+BF4fSZaXg QtsbrLFT1izcynz27/T9fp5b1A49TbFi+MMz6W6tkv3fle2n4u5t9l4jtl71vu/lBo8+Ye2uw+x +s9kA X-Developer-Key: i=sven@kernel.org; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@kernel.org/default with auth_id=407 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250821_084005_477153_D26A1CD2 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Hector Martin 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 Signed-off-by: Sven Peter --- drivers/usb/typec/tipd/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index b0fdd4dddd3a490dbc2a8ced21ea0803658f36a7..2b7c5017a347d153b50383b34123a2ecc424eb68 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -1552,11 +1552,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"); -- 2.34.1 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy