mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
To: Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Subject: [PATCH] clk: en7523: drop PHY_MODE_USB_DEVICE_SS from serdes mux guards
Date: Sat, 28 Nov 2026 16:49:56 +0530	[thread overview]
Message-ID: <20261128-clk-change-phy-modify-v1-1-fa6809007198@oss.qualcomm.com> (raw)

The two USB serdes port validation guards in en7581_serdes_phy_set_mode()
accepted PHY_MODE_USB_DEVICE_SS as an alias for PHY_MODE_USB_DEVICE.

No caller in the tree ever passed PHY_MODE_USB_DEVICE_SS to these paths —
the _SS guard was therefore dead code. Both cases already fell into the
same else branch (REG_SSUSB_HSGMII_SEL_USB / REG_USB_PCIE_SEL_USB), so
the two modes were handled identically anyway.

As a prerequisite to removing the eight speed-suffixed enum phy modes:
PHY_MODE_USB_{HOST,DEVICE}_{LS,FS,HS,SS} in favour of communicating link
speed through phy_configure(), remove the dead _SS arms here.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
I don't have a device to test this change. Hence compile testing with
W=1 now. This is a pre-requisite patch to remove the dead suffix enums.
The effort being put now is to remove the speed suffixed enums and replace
them with phy_configure API to let consumer drivers set usb phy opts along
with phy_set_mode call being done here. If the maintainers decide that
this change is not dead code removal and _SS enum is intended in the code,
although no one sets in the tree currently, then phy_configure can be done
from consumer drivers.
---
 drivers/clk/clk-en7523.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
index b38d7b5dc0ac..a30b83a5020c 100644
--- a/drivers/clk/clk-en7523.c
+++ b/drivers/clk/clk-en7523.c
@@ -942,8 +942,7 @@ static int en7581_serdes_phy_set_mode(struct phy *phy, enum phy_mode mode,
 		reg = REG_NP_SCU_SSR3;
 		mask = REG_SSUSB_HSGMII_SEL_MASK;
 
-		if (mode != PHY_MODE_ETHERNET && mode != PHY_MODE_USB_DEVICE &&
-		    mode != PHY_MODE_USB_DEVICE_SS)
+		if (mode != PHY_MODE_ETHERNET && mode != PHY_MODE_USB_DEVICE)
 			return -EINVAL;
 
 		if (mode == PHY_MODE_ETHERNET)
@@ -956,8 +955,7 @@ static int en7581_serdes_phy_set_mode(struct phy *phy, enum phy_mode mode,
 		reg = REG_NP_SCU_SSTR;
 		mask = REG_USB_PCIE_SEL_MASK;
 
-		if (mode != PHY_MODE_PCIE && mode != PHY_MODE_USB_DEVICE &&
-		    mode != PHY_MODE_USB_DEVICE_SS)
+		if (mode != PHY_MODE_PCIE && mode != PHY_MODE_USB_DEVICE)
 			return -EINVAL;
 
 		if (mode == PHY_MODE_PCIE)

---
base-commit: d8f05ec001e838cdb94fc14efa7c411e676f9ab9
change-id: 20261128-clk-change-phy-modify-0f08730f5863

Best regards,
--  
Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>


                 reply	other threads:[~2026-11-28 11:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261128-clk-change-phy-modify-v1-1-fa6809007198@oss.qualcomm.com \
    --to=krishna.kurapati@oss.qualcomm.com \
    --cc=bmasney+clk@redhat.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®