From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Pitre Subject: Re: [PATCH] net/smsc911x: add device tree probe support Date: Mon, 25 Jul 2011 22:28:05 -0400 (EDT) Message-ID: References: <1311587040-8988-1-git-send-email-shawn.guo@linaro.org> <20110725213723.GI26735@ponder.secretlab.ca> <20110726010154.GG21641@S2100-06.ap.freescale.net> <20110726013026.GH21641@S2100-06.ap.freescale.net> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Grant Likely , patches@linaro.org, netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Steve Glendinning , Shawn Guo , "David S. Miller" , linux-arm-kernel@lists.infradead.org To: Shawn Guo Return-path: Received: from mail-vx0-f174.google.com ([209.85.220.174]:62472 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752768Ab1GZC2I (ORCPT ); Mon, 25 Jul 2011 22:28:08 -0400 Received: by vxh35 with SMTP id 35so15621vxh.19 for ; Mon, 25 Jul 2011 19:28:08 -0700 (PDT) In-Reply-To: <20110726013026.GH21641@S2100-06.ap.freescale.net> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 26 Jul 2011, Shawn Guo wrote: > On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > > > Signed-off-by: Shawn Guo > > > > > Cc: Grant Likely > > > > > Cc: Steve Glendinning > > > > > Cc: David S. Miller > > > > > --- > > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > > new file mode 100644 > > > > > index 0000000..1920695 > > > > > --- /dev/null > > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > > @@ -0,0 +1,34 @@ > > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > > + > > > > > +Required properties: > > > > > +- compatible : Should be "smsc,lan""smsc,lan" > > > > > > > > Drop "smsc,lan". That's far too generic. > > > > > > > The following devices are supported by the driver. > > > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > > LAN9215, LAN9216, LAN9217, LAN9218 > > > LAN9210, LAN9211 > > > LAN9220, LAN9221 > > > > > > If we only keep specific as the compatible, we will have a > > > long match table which is actually used nowhere to distinguish the > > > device. > > > > > > So we need some level generic compatible to save the meaningless > > > long match table. What about: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan9", }, > > > { /* sentinel */ } > > > }; > > > > > > Or: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan91", }, > > > { .compatible = "smsc,lan92", }, > > > { /* sentinel */ } > > > }; > > > > None of this unambiguously distinguish the devices supported by this > > driver and the smc91x driver which supports LAN91C92, LAN91C94, > > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > > > So you suggest to make a long list to explicitly tell the device type > that the driver supports? I'm not suggesting anything. :-) I'm merely pointing out that the above .compatible = "smsc,lan9" or .compatible = "smsc,lan91" are too generic given that there is another driver with different devices to which they could also apply. Nicolas From mboxrd@z Thu Jan 1 00:00:00 1970 From: nicolas.pitre@linaro.org (Nicolas Pitre) Date: Mon, 25 Jul 2011 22:28:05 -0400 (EDT) Subject: [PATCH] net/smsc911x: add device tree probe support In-Reply-To: <20110726013026.GH21641@S2100-06.ap.freescale.net> References: <1311587040-8988-1-git-send-email-shawn.guo@linaro.org> <20110725213723.GI26735@ponder.secretlab.ca> <20110726010154.GG21641@S2100-06.ap.freescale.net> <20110726013026.GH21641@S2100-06.ap.freescale.net> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 26 Jul 2011, Shawn Guo wrote: > On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > > > Signed-off-by: Shawn Guo > > > > > Cc: Grant Likely > > > > > Cc: Steve Glendinning > > > > > Cc: David S. Miller > > > > > --- > > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > > new file mode 100644 > > > > > index 0000000..1920695 > > > > > --- /dev/null > > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > > @@ -0,0 +1,34 @@ > > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > > + > > > > > +Required properties: > > > > > +- compatible : Should be "smsc,lan""smsc,lan" > > > > > > > > Drop "smsc,lan". That's far too generic. > > > > > > > The following devices are supported by the driver. > > > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > > LAN9215, LAN9216, LAN9217, LAN9218 > > > LAN9210, LAN9211 > > > LAN9220, LAN9221 > > > > > > If we only keep specific as the compatible, we will have a > > > long match table which is actually used nowhere to distinguish the > > > device. > > > > > > So we need some level generic compatible to save the meaningless > > > long match table. What about: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan9", }, > > > { /* sentinel */ } > > > }; > > > > > > Or: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan91", }, > > > { .compatible = "smsc,lan92", }, > > > { /* sentinel */ } > > > }; > > > > None of this unambiguously distinguish the devices supported by this > > driver and the smc91x driver which supports LAN91C92, LAN91C94, > > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > > > So you suggest to make a long list to explicitly tell the device type > that the driver supports? I'm not suggesting anything. :-) I'm merely pointing out that the above .compatible = "smsc,lan9" or .compatible = "smsc,lan91" are too generic given that there is another driver with different devices to which they could also apply. Nicolas