From nobody Sun Dec 14 12:12:40 2025 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4D202F85B for ; Thu, 22 May 2025 13:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747919984; cv=none; b=jWJL25QbMPLOwzPy+jQFX+hyfkTvVQ858JuaRk3SYboVfKMNK7XAnNe/aW3b191MC7J4dYcjujF3ELjfUiWW52Qn/Vce3VVyBOybanml34QPAi62uaGDMNSDbTX2aETn/qrVLsBcfaMXScUfKAzHjeGVYJC7xyxud3whMBMPbXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747919984; c=relaxed/simple; bh=OoUe0D3OUFbjbHWNDKuCTzdMXzlvgmA5IBnMGnJgbk8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Xy4CEgS+ebMPEzTgiT0plqHjFl09gUlNrKLEgKhUeC37rwMpPtTuig+EYmzrtDxSGnPdOOhdeH7btDARQW7ItlMp0EWGEMN70oatvvtpU1IWQLCNGse5MaHlSpzf1KjdN+5pclhbZRR9V5JjcEGj0s6rlN8vgedo0xtDCqGiI/s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fkb7+nGF; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fkb7+nGF" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1747919980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EsWesO4sxz1LlUTR6SNF4pk6GAEisGaVRrkkPirpVNY=; b=fkb7+nGFgpQ17dT1gc1eDBaDeAOGw6YaZVwsIwFOloVzcP/dg2hAbM00XPX92tE1gTmQnM R0dvV0EdrsrA5seBQ9Uf22CQFScPJuMqWvksLJ2r0AetgZU/cijIpgfkLZwjKtUGHea72v /1a8GtD4kx3FifOaOkmgletbOCFIIJs= From: Yajun Deng To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH net-next] net: phy: Synchronize c45_ids to phy_id Date: Thu, 22 May 2025 21:19:18 +0800 Message-Id: <20250522131918.31454-1-yajun.deng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The phy_id_show() function emit the phy_id for the phy device. If the phy device is a c45 device, the phy_id is empty. In other words, phy_id_show() only works with the c22 device. Synchronize c45_ids to phy_id, phy_id_show() will work with both the c22 and c45 devices. Signed-off-by: Yajun Deng --- drivers/net/phy/phy_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 2eb735e68dd8..6fed3e84e1a6 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -690,8 +690,12 @@ struct phy_device *phy_device_create(struct mii_bus *b= us, int addr, u32 phy_id, dev->pma_extable =3D -ENODATA; dev->is_c45 =3D is_c45; dev->phy_id =3D phy_id; - if (c45_ids) + if (c45_ids) { dev->c45_ids =3D *c45_ids; + dev->phy_id =3D dev->c45_ids.device_ids[MDIO_MMD_PMAPMD]; + if (!dev->phy_id) + dev->phy_id =3D dev->c45_ids.device_ids[MDIO_MMD_PCS]; + } dev->irq =3D bus->irq[addr]; =20 dev_set_name(&mdiodev->dev, PHY_ID_FMT, bus->id, addr); --=20 2.25.1