Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6884596rdb; Tue, 2 Jan 2024 18:03:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7YueuNG/pPotCrq+vpsF5Xoqps0rSbYG/mQH0bI9TZX1YkvWOjuosuLdKrlYiVPgnTGEJ X-Received: by 2002:a05:622a:4cf:b0:427:e844:a95d with SMTP id q15-20020a05622a04cf00b00427e844a95dmr10747322qtx.50.1704247417849; Tue, 02 Jan 2024 18:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704247417; cv=none; d=google.com; s=arc-20160816; b=YSjG6qg1ZF/NFtRthaxR0zYGu7FKcDIjThxffRy8RTpb7gr0k0xrOyl/A1jmh/dyPq LnSZvhzI80zQ0wt7nSFgnIzDHn02u1fbWIzA1cqQomRJEzMpJp3MP9zCL/KaxMW6tH5b JuOtP0bDSZ62YMWNzgpoYr/1eMu60h7muEkyhmK0SJI5Zrnp06HgaPts9+A2tNjtKDC0 55D4NTvGrY7nyafk7CEsMv8g6hOg38tZv4OvrwvC5POryHN+xHwwWPX+RbWvnKucyJsE UW5Xhw4+hogOJkz8FxBpKMs3OAGv6jtLNn8lRtBD3dJKzgxHIWEpyO69/zmeQgAecPcp VmtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=eOagWnUDEoE7GjMOwjXwuSws8DvWaGldfOWW9LSOez0=; fh=H2avzKUuQWVE5htp7tBfODochNYQwOnJ6+V7VYxZojw=; b=Gge9MuYTokM1LZhu5ncK1AM94Jb9fDI6gEvRv1KainZXp6w3AzMIMj6Nv2/hixJFGZ rZi7LFocM1JZg1SucvsLpjC2jqRM8Ydc890X4uU4t2cKgCQV0QLTGPxeWsEKw8rLMQGs LdjMEqJHBEIMdRnOCpGtL4J9i8ToWpQ50CBBx5k9/VYFvqyjAQHPsvIEIvZxhUQX0j0d VStxqgkL8JiiFU5x842bxuVhZhIlntXRCQ1JcTxmGYnKmaBCEdW36KfV+ir1zQ8sWRRV cz/qEb66M7HQmxLyaCLXyiVdS/yAwoZxIAfFhNN636pf1Cdrun6REyQHDQmsjzGnSYZc kklw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=AvNSM4tn; spf=pass (google.com: domain of linux-kernel+bounces-15057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15057-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n1-20020ac85a01000000b004258996a155si28708418qta.266.2024.01.02.18.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 18:03:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=AvNSM4tn; spf=pass (google.com: domain of linux-kernel+bounces-15057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15057-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 97D971C21D23 for ; Wed, 3 Jan 2024 02:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D47F15C9A; Wed, 3 Jan 2024 02:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="AvNSM4tn" X-Original-To: linux-kernel@vger.kernel.org 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 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.