Message ID | 20230620-feature-c45-over-c22-v2-2-def0ab9ccee2@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5670965vqr; Fri, 23 Jun 2023 03:34:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6E7RFhCjgTsNpLIeOHqzyGbuBJ6Q0p/lKeMEXZvc/OTMTxkgXSoJJ2HAXPvD63xdGEsbYH X-Received: by 2002:a05:6a00:1a89:b0:668:7744:10f5 with SMTP id e9-20020a056a001a8900b00668774410f5mr13896912pfv.10.1687516486244; Fri, 23 Jun 2023 03:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687516486; cv=none; d=google.com; s=arc-20160816; b=Rt6jN+pIoue6QquRaPJ/gsa4ZAen4vE6L9n/v4oeJWF6YpZmsdM8Ac0Ft6R9NIwbL7 JXGDUd3WH/TmHe+hZABm8n4UvfxKt7dwrMr2uOWLu/yn5GGhd0fXiFC6zt1hh39FrbmF hTLquZiLxBIWaq4SqECiB2WCUV0K2Xabh9feg+myzHDsmWbfPZPVVOPJSZGvNCjC5JZS uQdp+lO0ffM2ZosYF00kjayVU+/OdsjjJX2HK2X9D5NGtNav/F3S44fm/LOj1cq+l7NR 3kF8WpzS8IGGzykL+dEAiHQ0oiImd+pflOWmTgpDAfMzo0ClGw6ZxnHPdxz7Fqofx24E Th1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=OU7+4qsJlAMGD194fx1AaI3yHYu8KdEChrNhRSexvu0=; b=R7OR3Zh6SIeRm5S8uiEzbGHl8Af8vGLDbMdAI8RP/GnqPtOifJhLSu5/NPeSjwLNF7 D1OqmgyOfN4KrJKGBCaKBkEQYooJ6MiuytG0oHXjchFqHsEjdhHLIfwtFkFEpXLJNF8I OSYOy8/XOH14Brmt//jWV77AgwGbniGvKjoXfGhagAzAJpUtaxfHCC5gbda/1Tt+Wepq Bp71eC6BHoY3eGVhbWaXcplrVFvK+ICqutA7AHTVcbvUbTHzgH4swXBHMy2+dRlPsPpW klN9I9jGi4I+Co6WFE7ZZDM74MS1aeUdSsOJzx6xG6xTjNFNuerEHpdFwBDEiIl36fqa p64Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HB4DiJYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020aa7972b000000b00661cd40bd67si8206577pfg.314.2023.06.23.03.34.27; Fri, 23 Jun 2023 03:34:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HB4DiJYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232099AbjFWK3j (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Fri, 23 Jun 2023 06:29:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbjFWK33 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 23 Jun 2023 06:29:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4687D170B for <linux-kernel@vger.kernel.org>; Fri, 23 Jun 2023 03:29:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C9DD061A0A for <linux-kernel@vger.kernel.org>; Fri, 23 Jun 2023 10:29:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09EC6C433CD; Fri, 23 Jun 2023 10:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687516167; bh=6hu2QLAnatQP5UFKHqQxLipPsz8mKS6yWJMOvqrfh4E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HB4DiJYFdsC6nwsmuBDgpqzoftv3wGE9kx2A/mRbaPiEWS39Oqg+CY8ll48GHQJBW VXtDxP4I7g2jundKpNXZnzc22jw/AyQhuBaAZag0Do7EFWom6vRJhQN8FuVDOaXjST gDd6u8/UwkNkhWnxOyZrHo0f/5I+y1eLyNtJmxFgF65bbTTEF3m1b3rD83F4s3Dyns Ka1d3Wdk6nIWJQt4/vH4gtRHBXYuwRpxCpEJPEYIcSq9GYwHqKl1SpNN6xdv5sa+V6 sW6WMUGj+O+RKNnKHb2TPN1BnATO1gAqNWdgq5eKjAgRlkwJgh2nGTD/fGp1CcL8Co gSy3OVqo7WZrA== From: Michael Walle <mwalle@kernel.org> Date: Fri, 23 Jun 2023 12:29:11 +0200 Subject: [PATCH net-next v2 02/10] net: phy: get rid of redundant is_c45 information MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230620-feature-c45-over-c22-v2-2-def0ab9ccee2@kernel.org> References: <20230620-feature-c45-over-c22-v2-0-def0ab9ccee2@kernel.org> In-Reply-To: <20230620-feature-c45-over-c22-v2-0-def0ab9ccee2@kernel.org> To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Yisen Zhuang <yisen.zhuang@huawei.com>, Salil Mehta <salil.mehta@huawei.com>, Florian Fainelli <florian.fainelli@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, =?utf-8?q?Marek_Beh=C3=BAn?= <kabel@kernel.org>, Xu Liang <lxu@maxlinear.com> Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle <mwalle@kernel.org> X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769489287183801525?= X-GMAIL-MSGID: =?utf-8?q?1769489287183801525?= |
Series |
net: phy: C45-over-C22 access
|
|
Commit Message
Michael Walle
June 23, 2023, 10:29 a.m. UTC
phy_device_create() will be called with is_c45 and c45_ids. If c45_ids
are set, is_c45 is (usually) true. Change the only caller which do
things differently, then drop the is_c45 check in phy_device_create().
This is a preparation patch to replace the is_c45 boolean with an enum
which will indicate how the PHY is accessed (by c22, c45 or
c45-over-c22).
Signed-off-by: Michael Walle <mwalle@kernel.org>
---
drivers/net/phy/phy_device.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 0c2014accba7..226d5507c865 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -689,7 +689,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, * driver will get bored and give up as soon as it finds that * there's no driver _already_ loaded. */ - if (is_c45 && c45_ids) { + if (c45_ids) { const int num_ids = ARRAY_SIZE(c45_ids->device_ids); int i; @@ -970,7 +970,8 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) true, &c45_ids); } - return phy_device_create(bus, addr, phy_id, is_c45, &c45_ids); + return phy_device_create(bus, addr, phy_id, is_c45, + !is_c45 ? NULL : &c45_ids); } EXPORT_SYMBOL(get_phy_device);