From nobody Mon Feb 9 01:45:36 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF79DEB64DD for ; Fri, 23 Jun 2023 10:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232194AbjFWK3k (ORCPT ); Fri, 23 Jun 2023 06:29:40 -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 ); 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 ; 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 ; 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 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: quoted-printable 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 , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yisen Zhuang , Salil Mehta , Florian Fainelli , Broadcom internal kernel review list , =?utf-8?q?Marek_Beh=C3=BAn?= , Xu Liang Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 *bu= s, 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 =3D ARRAY_SIZE(c45_ids->device_ids); int i; =20 @@ -970,7 +970,8 @@ struct phy_device *get_phy_device(struct mii_bus *bus, = int addr, bool is_c45) true, &c45_ids); } =20 - 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); =20 --=20 2.39.2