linux-phy.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Yajun Deng <yajun.deng@linux.dev>
Cc: "Russell King (Oracle)" <linux@armlinux.org.uk>,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, olteanv@gmail.com, hkallweit1@gmail.com,
	kabel@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH net-next] net: phy: Cleanup struct mdio_driver_common
Date: Wed, 3 Jan 2024 14:30:20 +0100	[thread overview]
Message-ID: <7367681a-3ef5-42ad-9c2f-173f77cc1b56@lunn.ch> (raw)
In-Reply-To: <52ea5dbf-2d60-7a23-e525-9dcae2809554@linux.dev>

On Wed, Jan 03, 2024 at 07:38:04PM +0800, Yajun Deng wrote:
> 
> On 2024/1/3 18:51, Russell King (Oracle) wrote:
> > On Wed, Jan 03, 2024 at 10:03:14AM +0800, Yajun Deng wrote:
> > > On 2024/1/3 01:34, Russell King (Oracle) wrote:
> > > > 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 ...
> > ... which is fine for those other drivers because they don't share the
> > same bus. That is not the case here - we have two different classes
> > of drivers on the same bus.
> 
> 
> Yes, that's true. But we can implement it with is_phy_driver(). I don't
> think we need a flag for that.
> 
> > 
> > I don't like a justification that just because other subsystems do
> > something in one particular way, that is the only way things should be
> > done. I think there is good reason to have the structure we have, and
> > thus there needs to be a good reason to change it.
> 
> Its purpose is to clean up struct mdio_driver_common, and make the code
> cleaner.

I have to agree with Russell here. The commit message should explain
the 'Why?'. Why is this better? Why is it cleaner? Why does making it
the same as all other drivers make it better, when in fact we have two
classes of devices stacked on top of it, and making it different to
every other driver actually helps developers realise that?

      Andrew

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2024-01-03 13:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28  7:23 [PATCH net-next] net: phy: Cleanup struct mdio_driver_common Yajun Deng
2023-12-28  8:24 ` Przemek Kitszel
2023-12-28  8:37   ` Yajun Deng
2024-01-02 17:34 ` Russell King (Oracle)
2024-01-03  2:03   ` Yajun Deng
2024-01-03 10:51     ` Russell King (Oracle)
2024-01-03 11:38       ` Yajun Deng
2024-01-03 13:30         ` Andrew Lunn [this message]
2024-01-03 18:25 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7367681a-3ef5-42ad-9c2f-173f77cc1b56@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=yajun.deng@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).