From patchwork Mon Jan 16 12:55:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 13102981 X-Patchwork-Delegate: kuba@kernel.org 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 93E7AC54EBE for ; Mon, 16 Jan 2023 12:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231393AbjAPM5Q (ORCPT ); Mon, 16 Jan 2023 07:57:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbjAPM4s (ORCPT ); Mon, 16 Jan 2023 07:56:48 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8A01F926; Mon, 16 Jan 2023 04:55:39 -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 68D5516E8; Mon, 16 Jan 2023 13:55:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1673873737; 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=W5Spwn+5qRW864bp5C5OgGPVSnNBAMvY7J7oVAjQX4k=; b=yEEVhq99moifusghajmavnVyJawstON1afqC5Ff04kQU5FcGh+uBKpXdm+vTexU/67q7MJ kNEKHriYbGV8HSHSiTGmNNbXJIDYPz2PCIJL0w513IT7/2JFtP4uLWM5tvmoRwMjo6zV79 bm9Iy1ZK89C+HNt09RugGpVqIBI5yHMoAFsiR4x8JNl8M+XS3zLGLcIkh4Vs3U0x4RGofZ elYe1Bd8q3AOX/HETYv5xgbWsoQ/52E8XVlda3GogtajUnjVfaEEoPPhRNwXhVwOLZrg7f za0L4cmjFrEnvbiFWil9a5tSr1ZwDB2XxgTfW+xqEu+OPu/ZSp9YAp/vYTdSjQ== From: Michael Walle Date: Mon, 16 Jan 2023 13:55:16 +0100 Subject: [PATCH net-next 4/6] net: mdio: scan bus based on bus capabilities for C22 and C45 MIME-Version: 1.0 Message-Id: <20230116-net-next-remove-probe-capabilities-v1-4-5aa29738a023@walle.cc> References: <20230116-net-next-remove-probe-capabilities-v1-0-5aa29738a023@walle.cc> In-Reply-To: <20230116-net-next-remove-probe-capabilities-v1-0-5aa29738a023@walle.cc> To: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , Bryan Whitehead , UNGLinuxDriver@microchip.com, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Joel Stanley , Andrew Jeffery Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-aspeed@lists.ozlabs.org, Andrew Lunn , Michael Walle X-Mailer: b4 0.11.1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Andrew Lunn Now that all MDIO bus drivers which set probe_capabilities to MDIOBUS_C22_C45 have been converted to use the name API for C45 transactions, perform the scanning of the bus based on which methods the bus provides. Signed-off-by: Andrew Lunn Signed-off-by: Michael Walle Reviewed-by: Jesse Brandeburg --- drivers/net/phy/mdio_bus.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index f173c91842e0..34790e601cb1 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -710,9 +710,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) goto error_reset_gpiod; } - if (bus->probe_capabilities == MDIOBUS_NO_CAP || - bus->probe_capabilities == MDIOBUS_C22 || - bus->probe_capabilities == MDIOBUS_C22_C45) { + if (bus->read) { err = mdiobus_scan_bus_c22(bus); if (err) goto error; @@ -720,9 +718,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) prevent_c45_scan = mdiobus_prevent_c45_scan(bus); - if (!prevent_c45_scan && - (bus->probe_capabilities == MDIOBUS_C45 || - bus->probe_capabilities == MDIOBUS_C22_C45)) { + if (!prevent_c45_scan && bus->read_c45) { err = mdiobus_scan_bus_c45(bus); if (err) goto error;