netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dwmw2@infradead.org
Cc: richardcochran@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] phylib: Add autoload support for the LXT973 phy.
Date: Sat, 26 Jun 2010 22:16:20 -0700 (PDT)	[thread overview]
Message-ID: <20100626.221620.267962098.davem@davemloft.net> (raw)
In-Reply-To: <1277210293.21798.11.camel@localhost>

From: David Woodhouse <dwmw2@infradead.org>
Date: Tue, 22 Jun 2010 13:38:13 +0100

> Commit e13647c1 (phylib: Add support for the LXT973 phy.) added a new ID
> but neglected to also add it to the MODULE_DEVICE_TABLE.
> 
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Applied, thanks.

> When I did this stuff, I did wonder if we should make this happen
> automatically somehow. I pondered some dirty macro hack in
> phy_driver_register() which would do it somehow, but couldn't come up
> with anything that'd work.
> 
> Removing the phy_id and phy_id_mask from struct phy_driver and having a
> pointer to a match table would suck, since each driver only really
> matches one device/mask. (Even where a single C file has multiple
> drivers, they often differ in some methods or flags.)
> 
> The best option I can come up with right now, is probably to remove
> phy_id and phy_id_mask from phy_driver and put a pointer to the driver
> into the ID table, and take the ID table as the argument to
> phy_driver_register(). I'm not sure I like that very much though -- I'd
> prefer that we just remember to update the table and don't need to be
> forced :)
> 
> (Another cheap option is to pass the ID table as an extra argument to
> the existing phy_device_register(), I suppose, and it can just print a
> warning if it doesn't find the same phy_id and phy_id_mask in the table)

As our experience shows, people aren't remembering to do it so we have
to do something hard handed to make sure this doesn't break.

A compile time error out is the best, but if that is too hard or ugly
and we do it at run time then we should fail the register (not just
print a warning) if the table is incomplete.

Otherwise we run into cases where a developer adds several new IDs,
forgets some of the table entries, but only tries testing the ones he
did remember to add and doesn't notice the warning message.

      parent reply	other threads:[~2010-06-27  5:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 13:09 [PATCH] phylib: Add support for the LXT973 phy Richard Cochran
2010-06-01 22:39 ` Andy Fleming
2010-06-02 12:55   ` Richard Cochran
2010-06-02 13:07     ` Richard Cochran
2010-06-02 13:50     ` David Miller
2010-06-02 15:08       ` Richard Cochran
2010-06-02 15:15         ` David Miller
2010-06-03 11:28           ` Richard Cochran
2010-06-02 19:32       ` Andy Fleming
2010-06-05 14:00         ` Richard Cochran
2010-06-07  8:18           ` David Miller
2010-06-07 15:39             ` Andy Fleming
2010-06-07 15:39             ` Richard Cochran
2010-06-09 23:17               ` David Miller
2010-06-22 12:38 ` [PATCH] phylib: Add autoload " David Woodhouse
2010-06-23  5:37   ` Richard Cochran
2010-06-23  9:00     ` David Woodhouse
2010-06-27  5:16   ` David Miller [this message]

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=20100626.221620.267962098.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /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).