From patchwork Mon Jan 9 15:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 40932 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2222912wrt; Mon, 9 Jan 2023 07:37:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXs/KTARLHLbbwyJunrfV0fA6d3FQqbKRBIr03EU6yIQL2I50xs76aEjAdEg5E9f99+MFbcI X-Received: by 2002:a05:6a21:9218:b0:9d:efbf:787d with SMTP id tl24-20020a056a21921800b0009defbf787dmr77837351pzb.50.1673278666112; Mon, 09 Jan 2023 07:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673278666; cv=none; d=google.com; s=arc-20160816; b=SXwx2XOD67GVYEy5yk+HIwYJqhI0dsDkGUBH0HN7/G5JvJqb1Oa+Z25aQ7Omumbv3y PTctaI1VKCUQUu3TEcQ9jdNT+V7uugE7RPAl68JhcCO6WFeJYDpUYfC0ianelTwDfWNU MVY+YYopi7OnMvAwMBYUljTFmDgowAjVLjJqIqZtqW5imFhV17J4f7UEX1eNf8RB64Nr tx5USf4OsXilRJqWNgWYpu76SsKJjRspQYTPeUCg5EiGeARr7hEjGJ2YGT6pD69CL6aO HNZDeN3Vn8kw/cAS1kqqPKAKgexEsHJmdHMoPWhlEau2osK59jsTXN6gT6jxZkd+IKtS wlWw== 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=EEZ/v6UcgF8jAd9Bq5O3tQtWCx116rW0omeP9KEiKw0=; b=MHEdfG30cDFNtmXE/PyCV6uA+If1j5LUUnA2Sv2CXj4U7XqNX5wDQVw+CqzUIbynN1 UmLTmB0JJBR9kwQ9FvBWwArMbF1gN4me7b2BYEwipCIdJ52nA3MJUe1BGE7SZ8J6xm3j fX5cN4aI7if/EoNDazqSHM/JdMarEwqxrZGnCt3makv6ptgHyW0HiOs/pREMOvHAlNAO mk/W7ifoACBeB6/pjhSq+wJE86Ao1+l78ZbaFkeM7XO7gb7+MBbjspzKIUiqZDOzpMCK xdFaXrc7Hdstb/t3kD0cnSbCRITMoywZJ/8xpd/6UN+f/f4p0pNhrFsJkp4PeN+vkshG 9XVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=Bs1T9rGn; 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 t5-20020a056a0021c500b005803c45cc2dsi9864384pfj.48.2023.01.09.07.37.33; Mon, 09 Jan 2023 07:37:46 -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=Bs1T9rGn; 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 S234980AbjAIPcp (ORCPT + 99 others); Mon, 9 Jan 2023 10:32:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237165AbjAIPbu (ORCPT ); Mon, 9 Jan 2023 10:31:50 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 867151C12F; Mon, 9 Jan 2023 07:31:07 -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 9C6CD16AB; Mon, 9 Jan 2023 16:30:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1673278255; 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=EEZ/v6UcgF8jAd9Bq5O3tQtWCx116rW0omeP9KEiKw0=; b=Bs1T9rGnPcNDWGuFneTdy9igWqlryNH1KCei2Uj5Hkn+hyn/4RcpTKfU5FxN+9mkG0cItk oDcds7yka4Lo+6kYx8uuPk4A0MDiBqmXlj/ZUA3vClyZzU5J3kR71Ok9e9N03qilXOsPSP ARccQ562l4Dldsb2GNPyUmNozYRDv86gZoQLd0nDdlQTarGJfWAz3OSk2BxATqry9WUcA8 Byq3GMfp/V4KZ2J5A1+8REH//6yOfOgOlitmD775vxeXssp3hnJjUhwBEUxXKu5Ch6GHeu /63A9MmC2yeADSKKXUhbO+Fj8KVunDK4Gil1rRpugZ1ahPqyNpa1kshAACvF9Q== From: Michael Walle Date: Mon, 09 Jan 2023 16:30:45 +0100 Subject: [PATCH net-next v3 05/11] net: mdio: Move mdiobus_c45_addr() next to users MIME-Version: 1.0 Message-Id: <20221227-v6-2-rc1-c45-seperation-v3-5-ade1deb438da@walle.cc> References: <20221227-v6-2-rc1-c45-seperation-v3-0-ade1deb438da@walle.cc> In-Reply-To: <20221227-v6-2-rc1-c45-seperation-v3-0-ade1deb438da@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 , Vladimir Oltean 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?1754559850691541363?= X-GMAIL-MSGID: =?utf-8?q?1754559850691541363?= 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 f71ba6ab85a7..522cbe6a0b23 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -839,6 +839,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);