From patchwork Tue Dec 27 23:07:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 37019 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1622137wrt; Tue, 27 Dec 2022 15:09:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXvX1K1bUdbN53Sh5K73C00iqbVARaKS4KOVqbMMZ3ieNOxZRNxQLTK9CyAHHEwPN5aNzkoZ X-Received: by 2002:aa7:9255:0:b0:566:900e:1023 with SMTP id 21-20020aa79255000000b00566900e1023mr24617642pfp.3.1672182543682; Tue, 27 Dec 2022 15:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672182543; cv=none; d=google.com; s=arc-20160816; b=uCYWgbh5ThkFJ8PJTExcNj2n4KNe8UwoG6CU+aGPavQvFxwxLQYTkYooY+Id5e1yFa 63/8QffWeAGtpCUGZBjTwvFw0WFQ7ihowKosew50pLAI1s/w9fWXjAPFE3QfjWF+LTbA aTgO55oDomCCtuv4DNTdcfQHFc/lPObW22GmSAXqnD9HxCAsq1upB7VNpu67VZJz1YnF q2vIfImoXdfcFA/Ddc4hw9D+pyjKWmW6BnhfjCIFbZW3dew5RncW6uMjW26tPhmyA6tq 4nsRnb/fQXaCvjKQB+BFT42HA7Bgp82VO76rVKEjw1/wsDVdUkXc80oo7MUrtIDGKNXE F6vQ== 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=RO0MXmSJzEk+1zx4vJ29wns0CosdyJgZJOJENWjajGc=; b=WkysgAoeiWmUZnH7OL4hnt+qWgHmPtFn3d8755wBQs8K2Fo/a5A4tElQNIqWDR+sDt 06unCuizqihZcLfwSghqHaYgLeLW5HkoZdr9oNHOzuN6T0+WT5wYbbWD6xG7EwFfDvHR olD/dWExiBE4GBELWWlzGBkxA0X0rJEZY4oaX8H1hAsCV2q0LcfJo4Y//e5NBiNvPAE9 RWlnHsdoXoJUkN/HlI9WDv5ZNHUdunEYLkByQqFvibdd7D90YnyGXLgBdO0H6CFEdsvD SaPTS5LPG+3GCTUL8DiBwG3+0dgdc1tI7oCMeGIjgyvPmmwsmXakz42adHftEAPDpS6k OSrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=cYkMqjBQ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a056a00089400b00562a1693523si7545020pfj.20.2022.12.27.15.08.52; Tue, 27 Dec 2022 15:09:03 -0800 (PST) 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=@walle.cc header.s=mail2022082101 header.b=cYkMqjBQ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbiL0XIa (ORCPT + 99 others); Tue, 27 Dec 2022 18:08:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232208AbiL0XHp (ORCPT ); Tue, 27 Dec 2022 18:07:45 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A856455; Tue, 27 Dec 2022 15:07:30 -0800 (PST) Received: from mwalle01.sab.local (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 6A0FF16DE; Wed, 28 Dec 2022 00:07:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1672182447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RO0MXmSJzEk+1zx4vJ29wns0CosdyJgZJOJENWjajGc=; b=cYkMqjBQ7dPYmAfVqvYhpwUUd8PAVCQxNAv44EyS5NneWMCaFP2/jQxflBX576GAeO4jN3 oJ8kQsj589dVFjReDTPEFUy3sTTiOw1rfwUtVWMCX2+Qvk7jVh+iO9WIAW/51LTE08QL7s hww9jRl3aRrSVrylqfVG0jYZsZNcNaEV/udoM3iGXcnZJ6NdAP1/RzvmOybXEl4Se6MlVG pugns2OvZhW2L2IpeYqDRMuNEU8iw4LqTDn8c3eqA7Pk38UsuUPFb9+M/UJq97k4lGnpT2 KzwEYzMbJkQI8KW0EtoaLqHKJJKJSE2hhIf/SOjnC33OFAr98y5ofps8kuav5Q== From: Michael Walle Date: Wed, 28 Dec 2022 00:07:21 +0100 Subject: [PATCH RFC net-next v2 05/12] net: mdio: Move mdiobus_c45_addr() next to users MIME-Version: 1.0 Message-Id: <20221227-v6-2-rc1-c45-seperation-v2-5-ddb37710e5a7@walle.cc> References: <20221227-v6-2-rc1-c45-seperation-v2-0-ddb37710e5a7@walle.cc> In-Reply-To: <20221227-v6-2-rc1-c45-seperation-v2-0-ddb37710e5a7@walle.cc> To: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jose Abreu , Sergey Shtylyov , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , Sean Wang , Landen Chao , DENG Qingfang , Florian Fainelli , Vladimir Oltean , Matthias Brugger Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Andrew Lunn , Geert Uytterhoeven , Michael Walle X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753410482879909402?= X-GMAIL-MSGID: =?utf-8?q?1753410482879909402?= From: Andrew Lunn Now that mdiobus_c45_addr() is only used within the MDIO code during fallback, move the function next to its only users. This function should not be used any more in drivers, the c45 helpers should be used in its place, so hiding it away will prevent any new users from being added. Signed-off-by: Andrew Lunn Signed-off-by: Michael Walle --- drivers/net/phy/mdio_bus.c | 5 +++++ include/linux/mdio.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 20ba38a346fe..0b04ce3766c8 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -842,6 +842,11 @@ int __mdiobus_modify_changed(struct mii_bus *bus, int addr, u32 regnum, } EXPORT_SYMBOL_GPL(__mdiobus_modify_changed); +static u32 mdiobus_c45_addr(int devad, u16 regnum) +{ + return MII_ADDR_C45 | devad << MII_DEVADDR_C45_SHIFT | regnum; +} + /** * __mdiobus_c45_read - Unlocked version of the mdiobus_c45_read function * @bus: the mii_bus struct diff --git a/include/linux/mdio.h b/include/linux/mdio.h index 1e78c8410b21..97b49765e8b5 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h @@ -459,11 +459,6 @@ static inline int mdiodev_modify_changed(struct mdio_device *mdiodev, mask, set); } -static inline u32 mdiobus_c45_addr(int devad, u16 regnum) -{ - return MII_ADDR_C45 | devad << MII_DEVADDR_C45_SHIFT | regnum; -} - static inline u16 mdiobus_c45_regad(u32 regnum) { return FIELD_GET(MII_REGADDR_C45_MASK, regnum);