public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] openfirmware: adds sysfs nodes for openfirmware	devices
Date: Thu, 03 Mar 2005 13:19:34 -0500	[thread overview]
Message-ID: <42275536.8060507@suse.com> (raw)
In-Reply-To: <1109806334.5611.121.camel@gaston>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Benjamin Herrenschmidt wrote:
> On Tue, 2005-03-01 at 16:18 -0500, Jeffrey Mahoney wrote:
> 
>>This patch adds sysfs nodes that the hotplug userspace can use to load the
>>appropriate modules.
>>
>>In order for hotplug to work with macio devices, patches to module-init-tools
>>and hotplug must be applied. Those patches are available at:
>>
>>ftp://ftp.suse.com/pub/people/jeffm/linux/macio-hotplug/
>>
>>Signed-off-by: Jeff Mahoney <jeffm@suse.com>
> 
> 
>>+static ssize_t
>>+compatible_show (struct device *dev, char *buf)        
>>+{
>>+        struct of_device *of;
>>+        char *compat;
>>+        int cplen;
>>+        int length = 0;
>>+        
>>+        of = &to_macio_device (dev)->ofdev;
>>+	compat = (char *) get_property(of->node, "compatible", &cplen);
>>+	if (!compat) {
>>+		*buf = '\0';
>>+		return 0;
>>+	}
>>+	while (cplen > 0) {
>>+		int l;
>>+		length += sprintf (buf, "%s%s", length ? "," : "", compat);
>>+		buf += length;
>>+		l = strlen (compat) + 1;
>>+		compat += l;
>>+		cplen -= l;
>>+	}
>>+
>>+	return length;
>>+}
>>+
> 
> 
> There is a problem here. "," is a valid character within a "compatible"
> property, and is actually regulary used. Normally, "compatible" is a
> list, with '\0' beeing the separator. I suggest using CRLF instead.

Reviewing the 'compatible' values in my device-tree, I definately agree.
I can hack the pmac_zilog driver to test this out further - I've just
been using my airport card.

Are there any other "invalid" characters for the compatible property?
CRLF would work, but these values (as a group) need to be put into
modules.ofmap as well as passed via environment variables for hotplug.
As such, CRLF isn't really easiest choice to work with.

Is whitespace (in any form) allowed in the compatible value?

- -Jeff

- --
Jeff Mahoney
SuSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCJ1U2LPWxlyuTD7IRAopmAJ44hoUKoCrhdBSyAnCp+jzSauAZ8gCfXt7k
tSZa3KiwEybqOoVhPHsQ5Lg=
=9Cvt
-----END PGP SIGNATURE-----

  reply	other threads:[~2005-03-03 18:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01 21:18 [PATCH 2/3] openfirmware: adds sysfs nodes for openfirmware devices Jeffrey Mahoney
2005-03-02 23:32 ` Benjamin Herrenschmidt
2005-03-03 18:19   ` Jeff Mahoney [this message]
2005-03-03 20:23     ` Olaf Hering
2005-03-03 21:17       ` Jeff Mahoney
2005-03-04 11:02         ` Olaf Hering
2005-03-04 16:35           ` Jeff Mahoney
2005-03-13 15:17         ` Segher Boessenkool
2005-03-14 14:03           ` Benjamin Herrenschmidt
2005-03-14 14:06             ` Olaf Hering
2005-03-14 14:27             ` Segher Boessenkool
2005-03-14 15:04               ` Benjamin Herrenschmidt
2005-03-14 15:19                 ` Jeff Mahoney
2005-03-14 15:19                 ` Segher Boessenkool
2005-03-14 21:47                   ` Benjamin Herrenschmidt
2005-03-03 22:52     ` Benjamin Herrenschmidt

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=42275536.8060507@suse.com \
    --to=jeffm@suse.com \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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