All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jochen Friedrich <jochen@scram.de>
To: Timur Tabi <timur@freescale.com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: I2C node in device tree breaks old-style drivers
Date: Wed, 30 Jul 2008 12:54:27 +0200	[thread overview]
Message-ID: <48904863.7050902@scram.de> (raw)
In-Reply-To: <488F72C8.8010909@freescale.com>

Hi Timur,

> So my conclusion is that specifying an I2C node in the device tree *requires*
> that the driver be new-style.  Is there any way we can fix this?  I'm not going
> to have time to update the CS4270 driver to a new-style interface before the
> 2.6.27 window closes.

This conclusion is correct. One possible way to fix this is to add support for
blacklisting to drivers/of/base.c (untested):

[RFC] of: Support blacklisting and blacklist cs4270.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
 drivers/of/base.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index ad8ac1a..8c53b2c 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -404,13 +404,16 @@ EXPORT_SYMBOL(of_find_matching_node);
  * assumed that the data size is small and that the compatible values
  * should already be distinct enough to differentiate between SPI, I2C
  * and other devices.
+ *
+ * Blacklisting devices is supported by using NULL as modalias.
  */
 struct of_modalias_table {
 	char *of_device;
 	char *modalias;
 };
 static struct of_modalias_table of_modalias_table[] = {
-	/* Empty for now; add entries as needed */
+	/* Blacklisting cs4270 as this driver is currently old-style. */
+	{ "cirrus,cs4270",	NULL }
 };

 /**
@@ -441,6 +444,9 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
 		compatible = of_modalias_table[i].of_device;
 		if (!of_device_is_compatible(node, compatible))
 			continue;
+		/* Check for blacklisting */
+		if (!of_modalias_table[i].modalias)
+			return -ENODEV;
 		strlcpy(modalias, of_modalias_table[i].modalias, len);
 		return 0;
 	}
-- 
1.5.6.3

  reply	other threads:[~2008-07-30 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-29 19:43 I2C node in device tree breaks old-style drivers Timur Tabi
2008-07-30 10:54 ` Jochen Friedrich [this message]
2008-07-30 13:00   ` Timur Tabi

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=48904863.7050902@scram.de \
    --to=jochen@scram.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=timur@freescale.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.