From patchwork Sun Feb 18 19:00:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 202859 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp914250dyc; Sun, 18 Feb 2024 11:04:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUL+NX23IuFEYU0n/9GZgb7Jptex2h5j5yiQHiSJlm+tIGVPdz30i52HlvvwxexY2TcNAfGLb2p2sGdAk6B/4DNM3QW1Q== X-Google-Smtp-Source: AGHT+IGBbw7CTPTVCMjqAjE0QfKjvopmYle4iqbQV6ZMAyO6g9lBYlREnpcmH0BmdrwjfcnMNInn X-Received: by 2002:aa7:850b:0:b0:6e0:9e95:b3f8 with SMTP id v11-20020aa7850b000000b006e09e95b3f8mr9305103pfn.9.1708283084908; Sun, 18 Feb 2024 11:04:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708283084; cv=pass; d=google.com; s=arc-20160816; b=bn4yZIHAyzHxC0+orv6jFkj2qqVqTuxX+F0NSUcyHYFxRnEmx9BT5nm7U8MHQ8rWCg BdICidOAy7Pip9M+0s+0PoYhKSO7/4aXiq+c6omKotbKtG31lmz8+AG3H9Krr5dTTMk+ ZgWimWVbPAtufK9H+3KmJUuVJGCJ8L/rTgR0jRoRuLaMPuN/hOIL4JP68wfXVpZ0haWo Ivpxx92RXMa+LJEfHieQb4Og92drqnlDrJV4RKo/2X3Mu94rCR0s5i2hetzHCs9s3rBb o7Fmh/DzMEif7VFeT4mGX3p+XsotVgHV+ny40Y7WrUulzZyRDfhxEVn/ILtuOkjTGxmM b4yA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=xb5ObgV1b0NTnABEN6/+CA1UUGUDFrITZUbF1bp3zy8=; fh=OH7s0y4ha448Per6dKtGV0hT+ZsKviWOE56UFibxL/A=; b=0Z3GYPr5/2RBEDfI6uYi6ybxqPwYRSh42IK8+5yMXuThH2GIFv4Ci57ojRstIvGHl7 3QWwX3suCINKNS/1DuCIijkQ40DcXTM+H+kX5YuvIaq/a3PeTFa9HDYZXih5XYkRNoj3 qw0VFryE3kv+FIh7J0SeszznCGo74ynz1qakEXl3sfCHz4ORLu2up8TDrLCx84Ly8jy2 uaufgM0khIGXV1yCB4XtErzVh6amzaoYH2q2yIKNapPIF+Nf3sVO/5vx7+dn4N18QP3G Lm9j2USk5D+9QKBDmdBX2XENTmZ8ElvVSM4u28Ikpla9zM3P2C2omcpKoVuHgWfZBYjX HIjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O+4sgNXF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-70526-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70526-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cj10-20020a056a00298a00b006e46102e64bsi592936pfb.109.2024.02.18.11.04.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 11:04:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70526-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=O+4sgNXF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-70526-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70526-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B73DC282075 for ; Sun, 18 Feb 2024 19:04:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56B2276025; Sun, 18 Feb 2024 19:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O+4sgNXF" Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E1B371B52; Sun, 18 Feb 2024 19:00:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282852; cv=none; b=E3BAQUH4lF0lCNhNOPxTEP3fdBpM95WUueHVzJaDotyjyVTp2iL7PE6XSlal0ykVMNvuBpLxKclp7WB0A8eT1ve1Ox8vzwqMbsMxj6o7e/Zte8h3WoTB3kiiVVtDkS7om8vQtXEidHuzD7I8KcRSJlLuBEgznjMfZOgSHGTJsvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282852; c=relaxed/simple; bh=Pdd44FrDd8LXtjrVj7SjYcAmMigl0EYIfRo3HodS0aI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U9ohhOQPVv18EDQ60FaSAN8a5Hhbo9NhCte5tK3XR6gfQS1eJAP9WkYxXXywSqS9moQqM1RFZQmrGJACo1z/j9arvODe9JEXHcuy57GxbhjJQzudlc7FLCdm5VLh30ow9NpXAvFyvcWSqPb6da8zRRdkMAFr8vWpKPLzgjKMgno= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O+4sgNXF; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-33d3b43c492so415147f8f.3; Sun, 18 Feb 2024 11:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708282848; x=1708887648; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xb5ObgV1b0NTnABEN6/+CA1UUGUDFrITZUbF1bp3zy8=; b=O+4sgNXF9pAPla7XmtNsfrqLrIxM32qAwE+LtGEGJxdHPFiEg/1EKpmPgVFm7KqtRK 7RCI+HZZKfBo283RYhPVBHf8r1j4kp0wkedg3Axl9PrF+pRuQmXBmV7ycUJ4sgg4Crli 6LH1UgcPYtVdUYAcOty6yIZToknLfk9vdX1XJFQcvVA7htDG7w4k7S/xrHKG7a4PJGHQ r4Uta0TmfPUQflSGvQT+qoSngDMWKqcpaoJZTNS4oA2WFyQ08R4i9KNbGBFltRyNwHea 3skDXQxu73QN2T9VCtBOj4jw/+EVc1XyWdKjN+Y80jUAoHBFu9p8y5cEU17XpUhRATLK iiqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708282848; x=1708887648; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xb5ObgV1b0NTnABEN6/+CA1UUGUDFrITZUbF1bp3zy8=; b=uFBsqZXKirqVdEWWSxI+nkbQ87SKBw7xmH0Cad4sODsNCr0G7DHcghsyvdOGj3u2PB Sf0hd7uTpR0kTXHZvoY9PlJ3EeDr/aOuWlilBfwrLYBLCdGefo8yB1zM6y++Yjx6CDXw F3w21KY9sJOPJpqqEhpvtx71xKyByOgRWy7mgHWkvV+JBn3Z8FfWQZsTp/IMh++ioJNz xLu2Vk3ylVLbv2AHkZWfDYeaPNnYaOp9LVoJtnhkjMaPQWf+OweSC3A9UY+Q+RcWFUgp 4cGxiIsGazkJnbVM+pAx3jLt/VK/vcqphWFxmFuRipgcTQ34ofd4ubJkS2Y91N5XB82p orxA== X-Forwarded-Encrypted: i=1; AJvYcCW/q8ai/S0HGLV5zax89eScV787vWNe+/fLd5Xa+y7brAASHtjAYpMui7VdemlndbXfWYPRSiDjg481doYirJqZnASSCFKwrcr1NBalvFSVH7lLWosDgypKRYg1gj8Tgt7IDLH8 X-Gm-Message-State: AOJu0Yy7ppOVwa866G+EGiX00+FGGatSiLpqv9kHnB/Z6jSbpxo97uZI sH+TBQP1hfqZU3PRAwvYv/1/YvB3MT1ux7WDItkvFRYF1Fha/4yl X-Received: by 2002:a5d:4704:0:b0:33d:1d2f:1fdc with SMTP id y4-20020a5d4704000000b0033d1d2f1fdcmr4021243wrq.38.1708282848175; Sun, 18 Feb 2024 11:00:48 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id m15-20020a056000008f00b0033b728190c1sm8115762wrx.79.2024.02.18.11.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 11:00:47 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Broadcom internal kernel review list , Christian Marangi , Robert Marko , "Russell King (Oracle)" , Greg Kroah-Hartman , Pieter Jansen van Vuuren , Nipun Gupta , Andy Shevchenko , Puneet Gupta , Abhijit Gangurde , Umang Jain , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next RFC PATCH 4/6] net: phy: support named mdio_device_id PHY IDs Date: Sun, 18 Feb 2024 20:00:30 +0100 Message-ID: <20240218190034.15447-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240218190034.15447-1-ansuelsmth@gmail.com> References: <20240218190034.15447-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791264644111306316 X-GMAIL-MSGID: 1791264644111306316 PHY IDs defined in PHY driver .ids can have a more specific name defined. If this is the case, overwrite the PHY istance dev name with the more specific one from the matching dev_id. Signed-off-by: Christian Marangi --- drivers/net/phy/phy_device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 60a60f182729..9e359e304f91 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3471,9 +3471,15 @@ static int phy_probe(struct device *dev) */ if (phy_driver_match(phydrv, phydev, &dev_id) && dev_id) { memcpy(phy_dev_id, dev_id, sizeof(*dev_id)); + /* If defined, overwrite the PHY driver dev name with a + * more specific one from the matching dev_id. + */ + if (dev_id->name) + drv->name = dev_id->name; } else { phy_dev_id->phy_id = phydrv->phy_id; phy_dev_id->phy_id_mask = phydrv->phy_id_mask; + phy_dev_id->name = phydrv->name; } /* Fill PHY ID with dev_id if empty and PHY is C45 */