From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EBB8C46CD2 for ; Wed, 3 Jan 2024 02:03:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HwzSitUTs29kFlW/EGVvRfpBOlJ8QRLQYZUZCRTTYFE=; b=31lshie/eCnFDk QZnKJM+EiJsWfvpAaov8ITxcxQs8AQmnd2RCqEklOL2FaQUmItFwzOXRnQaQFZ541tXdWiQTQMWVJ WCHUlLvpA5HInzvmk2owTm1/MgicSWsh7Yny//kiMQRoZvcEcCqFN2ZV2tazd1KkXeB2gRTh6tkPp w+eFd3falspm6MgsVfMmfP0hVHdeUNjej3lFcyLWVt/aQEF2CPiLt9cMJqFXCaSJMIql7JQu4GZbj cNDMObNl7NzmhV6/WvX05623MEYrr+otrqAViUiva0plzRtLgYquvIG7nGHl0SXe4k1HGDqzFj5lB oiYzM4iBlCboScUPphSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rKqbU-009XFV-2o; Wed, 03 Jan 2024 02:03:32 +0000 Received: from out-185.mta0.migadu.com ([2001:41d0:1004:224b::b9]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rKqbR-009XEN-2q for linux-phy@lists.infradead.org; Wed, 03 Jan 2024 02:03:31 +0000 Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1704247402; 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=eOagWnUDEoE7GjMOwjXwuSws8DvWaGldfOWW9LSOez0=; b=AvNSM4tnQjbmv09Q1fefRqvvAEFSK5ZhpSZAjwRz+IznlQ9HIvGN6vebT2KRCNVc2kXoDb 8V2X5cSMaxQ74W/QoFqrQry++k5XYKI2eaYqE6gbJc0X8is3X/WQs5o+1OJiFbOZLwiKc9 +y3C32PXtTMm0avn2LH0rjW3cwsFm58= Date: Wed, 3 Jan 2024 10:03:14 +0800 MIME-Version: 1.0 Subject: Re: [PATCH net-next] net: phy: Cleanup struct mdio_driver_common Content-Language: en-US To: "Russell King (Oracle)" Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, olteanv@gmail.com, hkallweit1@gmail.com, kabel@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org References: <20231228072350.1294425-1-yajun.deng@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240102_180330_060849_2519FFC6 X-CRM114-Status: GOOD ( 15.92 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Sender: "linux-ph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xp bmcgbGlzdApsaW51eC1waHlAbGlzdHMuaW5mcmFkZWFkLm9yZwpodHRwczovL2xpc3RzLmluZnJh ZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51eC1waHkK From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (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 88A184A16 for ; Wed, 3 Jan 2024 02:03:24 +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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="AvNSM4tn" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1704247402; 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=eOagWnUDEoE7GjMOwjXwuSws8DvWaGldfOWW9LSOez0=; b=AvNSM4tnQjbmv09Q1fefRqvvAEFSK5ZhpSZAjwRz+IznlQ9HIvGN6vebT2KRCNVc2kXoDb 8V2X5cSMaxQ74W/QoFqrQry++k5XYKI2eaYqE6gbJc0X8is3X/WQs5o+1OJiFbOZLwiKc9 +y3C32PXtTMm0avn2LH0rjW3cwsFm58= Date: Wed, 3 Jan 2024 10:03:14 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net-next] net: phy: Cleanup struct mdio_driver_common Content-Language: en-US To: "Russell King (Oracle)" Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, olteanv@gmail.com, hkallweit1@gmail.com, kabel@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org References: <20231228072350.1294425-1-yajun.deng@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 2024/1/3 01:34, Russell King (Oracle) wrote: > On Thu, Dec 28, 2023 at 03:23:50PM +0800, Yajun Deng wrote: >> The struct mdio_driver_common is a wrapper for driver-model structure, >> it contains device_driver and flags. There are only struct phy_driver >> and mdio_driver that use it. The flags is used to distinguish between >> struct phy_driver and mdio_driver. >> >> We can test that if probe of device_driver is equal to phy_probe. This >> way, the struct mdio_driver_common is no longer needed, and struct >> phy_driver and usb_mdio_driver will be consistent with other driver >> structs. > usb_mdio_driver? This is a mistake. It should be 'mdio_driver'. > > I'm not sure why this consistency is even desired, the commit message > doesn't properly say _why_ this change is being proposed. Most drivers use device_driver directly. This should be added to the commit. Like this: struct sdio_driver { ... ...         struct device_driver drv; }; struct pcie_port_service_driver { ... ...         struct device_driver driver; }; and so on ... > >> +bool is_phy_driver(struct device_driver *driver) >> +{ >> + return driver->probe == phy_probe; >> +} >> +EXPORT_SYMBOL_GPL(is_phy_driver); > Do we really need this exported? It doesn't seem like something anything > other than core MDIO/phylib code should know about, and all that becomes > a single module when building it in a modular way - phylib can't be a > separate module from mdio stuff. I think this exported can be removed.