Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6899074rdb; Tue, 2 Jan 2024 18:54:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSocFFu9mtkORKsiHlIqwpG77AGsmCQ3sf0skS52YzzdpEwbiGa9/Q2ESrUGClxI+dJWnJ X-Received: by 2002:a17:907:7da1:b0:a26:a4bf:e8c0 with SMTP id oz33-20020a1709077da100b00a26a4bfe8c0mr11260226ejc.21.1704250461717; Tue, 02 Jan 2024 18:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704250461; cv=none; d=google.com; s=arc-20160816; b=fkrSpuRfFB9zYa8OGaJTtWt2wWcHaB8HM2WSZMBXL7JVppez/CmmI0Kkd5ecxUAEOD l2Lh9pyuayNYXFEIhwPN1qN0HOU9Oum5JszfvDzISVLFJf4o2i5aA7U4k6+EowvNAWpT 1LoiCmLcQfQvu3569Dzaq0U8WInvnHdmF19DQgeBN+3xKuHM7sc+ZRpT+3HqbkmURIMH 86vld5EGsH65fBWJuvl+q6maNoRFsMWRI9jFPjAo+uHIwG3PBSsF8lEo3s/FDi9xeH8w T/rxF0mDAx6/BQaO4h0wT6jJbpg971646fY1zezJcLIV4SHAEB1wcTt5Z0U4ig4RaPDN BWag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=jKg88EOc19Ldtm/CDT5Vvu/qnifyLXpVN7rl8hsod6M=; fh=ofXRanw8b8V3fyRJsU3Dni1vkxaQb8bG8RTS/EfAsMo=; b=w0FaKJ8v1PPuuWPHoOOoKbygoA9kmZEcL/9Wgpae2nuL98tkp5x12HikqYQSFndhD+ rXYMu977F0u5LcsRJkBvJT6t+vVZyj7ugXMJhSQFzHrCIIitLmGqaitSIbQmBu0FtNnZ pIMqw27zN2KH/y9bWydOKFBseHsRWiPoii064NGDbnH2ThBgXMtOt2Im97x8ngptsBf8 3vKGjmcaJo+seyeNPJ91FwyM4cwlSpQx70WBjBjv6U+GP+D7Mrlhea7BpusgqfDED4Hc yNqXxL0U2MnT4t4qNr4Ly8iOF6kvUemkg+r5Y03zgYkIbZbmjdyRDb7/DJEPkyo+VL1p 1LUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=IBcYPolr; spf=pass (google.com: domain of linux-kernel+bounces-15097-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15097-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qx7-20020a170906fcc700b00a236451ea1dsi3278925ejb.280.2024.01.02.18.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 18:54:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15097-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=IBcYPolr; spf=pass (google.com: domain of linux-kernel+bounces-15097-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15097-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 61BB21F2361D for ; Wed, 3 Jan 2024 02:54:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A692C4A2A; Wed, 3 Jan 2024 02:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="IBcYPolr" X-Original-To: linux-kernel@vger.kernel.org Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB0F94A13 for ; Wed, 3 Jan 2024 02:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1704250440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jKg88EOc19Ldtm/CDT5Vvu/qnifyLXpVN7rl8hsod6M=; b=IBcYPolrqPHkbUIAacMiHDSykXqfpBH/JtWC+mGENXrqYgL+J+GAviTeW33XVK+uKQ1aUS ej/JQPXJgzMZ1yzFAgvVC05anwGGffEMZwtKkv0a2HHKQVnbVTS0baW3X1EC0h9bgW5f+f OMbJajn+6efsgCyejh9OuK9uc6Zqufo= From: Yajun Deng To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: andrew@lunn.ch, olteanv@gmail.com, hkallweit1@gmail.com, linux@armlinux.org.uk, przemyslaw.kitszel@intel.com, rmk+kernel@armlinux.org.uk, kabel@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Yajun Deng Subject: [PATCH net-next v2 0/2] net: phy: Use is_phy_driver() and is_phy_device() Date: Wed, 3 Jan 2024 10:53:32 +0800 Message-Id: <20240103025334.541682-1-yajun.deng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT There is only one flag that can be set in struct mdio_driver_common and mdio_device. We can compare the probe of the driver or the type of the device to implement it. Hence, these flags in struct mdio_driver_common and mdio_device can be removed. Introduce is_phy_driver() and is_phy_device(). Use them test the driver or device. v1 -> v2: remove redundant parens and the exported. Yajun Deng (2): net: phy: Cleanup struct mdio_driver_common and introduce is_phy_driver() net: phy: Introduce is_phy_device() drivers/net/dsa/b53/b53_mdio.c | 2 +- drivers/net/dsa/dsa_loop.c | 2 +- drivers/net/dsa/lan9303_mdio.c | 2 +- drivers/net/dsa/microchip/ksz8863_smi.c | 2 +- drivers/net/dsa/mt7530-mdio.c | 2 +- drivers/net/dsa/mv88e6060.c | 2 +- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/qca/ar9331.c | 2 +- drivers/net/dsa/qca/qca8k-8xxx.c | 2 +- drivers/net/dsa/realtek/realtek-mdio.c | 2 +- drivers/net/dsa/xrs700x/xrs700x_mdio.c | 2 +- drivers/net/phy/mdio_bus.c | 7 ++-- drivers/net/phy/mdio_device.c | 21 +++++------- drivers/net/phy/phy_device.c | 44 ++++++++++++++----------- drivers/net/phy/xilinx_gmii2rgmii.c | 2 +- drivers/phy/broadcom/phy-bcm-ns-usb3.c | 8 ++--- drivers/phy/broadcom/phy-bcm-ns2-pcie.c | 8 ++--- include/linux/mdio.h | 19 ++--------- include/linux/phy.h | 10 +++--- 19 files changed, 62 insertions(+), 79 deletions(-) -- 2.25.1