[PATCH 1/2 v2] [OF] Add of_device_is_available function

Subsystems: the rest · Maintainer: Linus Torvalds

STALE6790d

21 messages, 10 authors, 2008-03-26 · open the first message on its own page

[PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Josh Boyer <hidden>
Date: 2008-03-01 14:18:09

IEEE 1275 defined a standard "status" property to indicate the
operational status of a device.  The property has four possible values:
okay, disabled, fail, fail-xxx.  The absence of this property means the
operational status of the device is unknown or okay.

This adds a function called of_device_is_available that checks the state
of the status property of a device.  If the property is absent or set to
either "okay" or "ok", it returns 1.  Otherwise it returns 0.

Signed-off-by: Josh Boyer <redacted>

---
 drivers/of/base.c  |   26 ++++++++++++++++++++++++++
 include/linux/of.h |    1 +
 2 files changed, 27 insertions(+)
--- linux-2.6.orig/drivers/of/base.c
+++ linux-2.6/drivers/of/base.c
@@ -117,6 +117,32 @@ int of_device_is_compatible(const struct
 EXPORT_SYMBOL(of_device_is_compatible);
 
 /**
+ *  of_device_is_available - check if a device is available for use
+ *
+ *  @device: Node to check for availability
+ *
+ *  Returns 1 if the status property is absent or set to "okay" or
"ok",
+ *  0 otherwise
+ */
+int of_device_is_available(const struct device_node *device)
+{
+	const char *status;
+	int statlen;
+
+	status = of_get_property(device, "status", &statlen);
+	if (status == NULL)
+		return 1;
+
+	if (statlen > 0) {
+		if (!strncmp(status, "okay", 4) || !strncmp(status,
"ok", 2))
+			return 1;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL(of_device_is_available);
+
+/**
  *	of_get_parent - Get a node's parent if any
  *	@node:	Node to get parent
  *
--- linux-2.6.orig/include/linux/of.h
+++ linux-2.6/include/linux/of.h
@@ -62,6 +62,7 @@ extern struct property *of_find_property
 					 int *lenp);
 extern int of_device_is_compatible(const struct device_node *device,
 				   const char *);
+extern int of_device_is_available(const struct device_node *device);
 extern const void *of_get_property(const struct device_node *node,
 				const char *name,
 				int *lenp);

[PATCH 2/2 v2] [POWERPC] Ignore disabled serial ports

From: Josh Boyer <hidden>
Date: 2008-03-01 14:19:57

Some SoC chips have multiple serial ports on board.  The usability of these
ports can rely on various factors, ranging from pin sharing to unpopulated
connectors.  This checks for a status property in the serial node and ignores
the port if it is set to "disabled".

Signed-off-by: Josh Boyer <redacted>

---
 arch/powerpc/kernel/legacy_serial.c |    4 ++++
 drivers/serial/of_serial.c          |    5 +++++
 2 files changed, 9 insertions(+)
--- linux-2.6.orig/drivers/serial/of_serial.c
+++ linux-2.6/drivers/serial/of_serial.c
@@ -72,6 +72,11 @@ static int __devinit of_platform_serial_
 	int port_type;
 	int ret;
 
+	if (!of_device_is_available(ofdev->node)) {
+		dev_info(&ofdev->dev, "Disabled serial port.  Ignored\n");
+		return -ENODEV;
+	}
+
 	if (of_find_property(ofdev->node, "used-by-rtas", NULL))
 		return -EBUSY;
 
--- linux-2.6.orig/arch/powerpc/kernel/legacy_serial.c
+++ linux-2.6/arch/powerpc/kernel/legacy_serial.c
@@ -54,6 +54,10 @@ static int __init add_legacy_port(struct
 	u32 clock = BASE_BAUD * 16;
 	int index;
 
+	/* Check the status property if present.  Ignore disabled devices */
+	if (!of_device_is_available(np))
+		return -1;
+
 	/* get clock freq. if present */
 	clk = of_get_property(np, "clock-frequency", NULL);
 	if (clk && *clk)

[PATCH 3/2][NEWEMAC] Use status property for unused/unwired EMACs

From: Josh Boyer <hidden>
Date: 2008-03-01 14:43:49

Convert ibm_newemac to use the of_device_is_available function when checking
for unused/unwired EMACs.  We leave the current check for an "unused" property
to maintain backwards compatibility for older device trees.  Newer device
trees should simply use the standard "status" property in the EMAC node.

The taishan DTS file is updated to reflect this.

Signed-off-by: Josh Boyer <redacted>

---
 arch/powerpc/boot/dts/taishan.dts |    4 ++--
 drivers/net/ibm_newemac/core.c    |    7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)
--- linux-2.6.orig/arch/powerpc/boot/dts/taishan.dts
+++ linux-2.6/arch/powerpc/boot/dts/taishan.dts
@@ -234,7 +234,6 @@
 
 
 			EMAC0: ethernet@40000800 {
-				unused = <1>;
 				linux,network-index = <2>;
 				device_type = "network";
 				compatible = "ibm,emac-440gx", "ibm,emac4";
@@ -253,9 +252,9 @@
 				phy-map = <00000001>;
 				zmii-device = <&ZMII0>;
 				zmii-channel = <0>;
+				status = "disabled";
 			};
 		 	EMAC1: ethernet@40000900 {
-				unused = <1>;
 				linux,network-index = <3>;
 				device_type = "network";
 				compatible = "ibm,emac-440gx", "ibm,emac4";
@@ -274,6 +273,7 @@
 				phy-map = <00000001>;
  				zmii-device = <&ZMII0>;
 				zmii-channel = <1>;
+				status = "disabled";
 			};
 
 		 	EMAC2: ethernet@40000c00 {
--- linux-2.6.orig/drivers/net/ibm_newemac/core.c
+++ linux-2.6/drivers/net/ibm_newemac/core.c
@@ -2552,8 +2552,11 @@ static int __devinit emac_probe(struct o
 	struct device_node **blist = NULL;
 	int err, i;
 
-	/* Skip unused/unwired EMACS */
-	if (of_get_property(np, "unused", NULL))
+	/* Skip unused/unwired EMACS.  We leave the check for an unused
+	 * property here for now, but new flat device trees should set a
+	 * status property to "disabled" instead.
+	 */
+	if (of_get_property(np, "unused", NULL) || !of_device_is_available(np))
 		return -ENODEV;
 
 	/* Find ourselves in the bootlist if we are there */

Re: [PATCH 3/2][NEWEMAC] Use status property for unused/unwired EMACs

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-03-01 21:34:48

On Sat, 2008-03-01 at 08:41 -0600, Josh Boyer wrote:
Convert ibm_newemac to use the of_device_is_available function when checking
for unused/unwired EMACs.  We leave the current check for an "unused" property
to maintain backwards compatibility for older device trees.  Newer device
trees should simply use the standard "status" property in the EMAC node.

The taishan DTS file is updated to reflect this.

Signed-off-by: Josh Boyer <redacted>
I don't think any other DTS than Taishan uses "unused" so we may be able
to get rid of that backward compat check. I think the Cell DT just
ommits EMACs when they are unused.

Ben.

Re: [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Stephen Rothwell <hidden>
Date: 2008-03-01 22:02:59

Hi Josh,

On Sat, 1 Mar 2008 08:16:00 -0600 Josh Boyer [off-list ref] wrote:
IEEE 1275 defined a standard "status" property to indicate the
operational status of a device.  The property has four possible values:
okay, disabled, fail, fail-xxx.  The absence of this property means the
operational status of the device is unknown or okay.

This adds a function called of_device_is_available that checks the state
of the status property of a device.  If the property is absent or set to
either "okay" or "ok", it returns 1.  Otherwise it returns 0.

Signed-off-by: Josh Boyer <redacted>
Looks good to me - except the patch is word wrapped (which is weird for
Claws) ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

Re: [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Josh Boyer <hidden>
Date: 2008-03-01 22:25:30

On Sun, 2 Mar 2008 09:02:18 +1100
Stephen Rothwell [off-list ref] wrote:
Hi Josh,

On Sat, 1 Mar 2008 08:16:00 -0600 Josh Boyer [off-list ref] wrote:
quoted
IEEE 1275 defined a standard "status" property to indicate the
operational status of a device.  The property has four possible values:
okay, disabled, fail, fail-xxx.  The absence of this property means the
operational status of the device is unknown or okay.

This adds a function called of_device_is_available that checks the state
of the status property of a device.  If the property is absent or set to
either "okay" or "ok", it returns 1.  Otherwise it returns 0.

Signed-off-by: Josh Boyer <redacted>
Looks good to me - except the patch is word wrapped (which is weird for
Claws) ...
That's weird indeed...  I've never had that happen before.  I'll resend.

josh

[RESEND] [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Josh Boyer <hidden>
Date: 2008-03-01 23:50:37

IEEE 1275 defined a standard "status" property to indicate the operational
status of a device.  The property has four possible values: okay, disabled,
fail, fail-xxx.  The absence of this property means the operational status
of the device is unknown or okay.

This adds a function called of_device_is_available that checks the state
of the status property of a device.  If the property is absent or set to
either "okay" or "ok", it returns 1.  Otherwise it returns 0.

Signed-off-by: Josh Boyer <redacted>

---
 drivers/of/base.c  |   26 ++++++++++++++++++++++++++
 include/linux/of.h |    1 +
 2 files changed, 27 insertions(+)
--- linux-2.6.orig/drivers/of/base.c
+++ linux-2.6/drivers/of/base.c
@@ -117,6 +117,32 @@ int of_device_is_compatible(const struct
 EXPORT_SYMBOL(of_device_is_compatible);
 
 /**
+ *  of_device_is_available - check if a device is available for use
+ *
+ *  @device: Node to check for availability
+ *
+ *  Returns 1 if the status property is absent or set to "okay" or "ok",
+ *  0 otherwise
+ */
+int of_device_is_available(const struct device_node *device)
+{
+	const char *status;
+	int statlen;
+
+	status = of_get_property(device, "status", &statlen);
+	if (status == NULL)
+		return 1;
+
+	if (statlen > 0) {
+		if (!strncmp(status, "okay", 4) || !strncmp(status, "ok", 2))
+			return 1;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL(of_device_is_available);
+
+/**
  *	of_get_parent - Get a node's parent if any
  *	@node:	Node to get parent
  *
--- linux-2.6.orig/include/linux/of.h
+++ linux-2.6/include/linux/of.h
@@ -62,6 +62,7 @@ extern struct property *of_find_property
 					 int *lenp);
 extern int of_device_is_compatible(const struct device_node *device,
 				   const char *);
+extern int of_device_is_available(const struct device_node *device);
 extern const void *of_get_property(const struct device_node *node,
 				const char *name,
 				int *lenp);

Re: [PATCH 3/2][NEWEMAC] Use status property for unused/unwired EMACs

From: Josh Boyer <hidden>
Date: 2008-03-01 23:52:27

On Sun, 02 Mar 2008 08:33:15 +1100
Benjamin Herrenschmidt [off-list ref] wrote:
On Sat, 2008-03-01 at 08:41 -0600, Josh Boyer wrote:
quoted
Convert ibm_newemac to use the of_device_is_available function when checking
for unused/unwired EMACs.  We leave the current check for an "unused" property
to maintain backwards compatibility for older device trees.  Newer device
trees should simply use the standard "status" property in the EMAC node.

The taishan DTS file is updated to reflect this.

Signed-off-by: Josh Boyer <redacted>
I don't think any other DTS than Taishan uses "unused" so we may be able
to get rid of that backward compat check. I think the Cell DT just
ommits EMACs when they are unused.
I wasn't sure on that aspect and I can't check until next week.  If you
can verify before I do, let me know.  I'll remove the "unused" check
assuming the of_device_is_available patch goes in and the Axon DT
doesn't use it.

josh

Re: [PATCH 3/2][NEWEMAC] Use status property for unused/unwired EMACs

From: Sean MacLennan <hidden>
Date: 2008-03-02 19:43:33

Josh Boyer wrote:
Convert ibm_newemac to use the of_device_is_available function when checking
for unused/unwired EMACs.  We leave the current check for an "unused" property
to maintain backwards compatibility for older device trees.  Newer device
trees should simply use the standard "status" property in the EMAC node.

The taishan DTS file is updated to reflect this.
  
What is the advantage of documenting unwired devices? I ask because the taco does not have emac1 connected. I handle it by not defining emac1 in the dts file.

Is it better to document it and disable it? Or is this mainly for reference boards to show that while the PPC supports to emacs, only one is enabled on the reference board?

i.e. We want reference design boards to show what *could* be done, but production boards to show what *is* done?

Cheers,
  Sean

Re: [PATCH 3/2][NEWEMAC] Use status property for unused/unwired EMACs

From: Josh Boyer <hidden>
Date: 2008-03-02 22:25:56

On Sun, 02 Mar 2008 14:43:31 -0500
Sean MacLennan [off-list ref] wrote:
Josh Boyer wrote:
quoted
Convert ibm_newemac to use the of_device_is_available function when checking
for unused/unwired EMACs.  We leave the current check for an "unused" property
to maintain backwards compatibility for older device trees.  Newer device
trees should simply use the standard "status" property in the EMAC node.

The taishan DTS file is updated to reflect this.
  
What is the advantage of documenting unwired devices? I ask because the 
taco does not have emac1 connected. I handle it by not defining emac1 in 
the dts file.
If it never has the possibility of becoming usable without some kind
of hardware rework, then that's probably best.
Is it better to document it and disable it? Or is this mainly for 
reference boards to show that while the PPC supports to emacs, only one 
is enabled on the reference board?

i.e. We want reference design boards to show what *could* be done, but 
production boards to show what *is* done?
Sort of.  A lot of these eval boards have DIP switches that change pins
to various devices.  So for those, we enumerate most things and we can
adjust the status property based on those settings in the
firmware/wrapper.

josh

Re: [PATCH 2/2 v2] [POWERPC] Ignore disabled serial ports

From: Arnd Bergmann <arnd@arndb.de>
Date: 2008-03-03 03:43:59

On Saturday 01 March 2008, Josh Boyer wrote:
quoted hunk
--- linux-2.6.orig/drivers/serial/of_serial.c
+++ linux-2.6/drivers/serial/of_serial.c
@@ -72,6 +72,11 @@ static int __devinit of_platform_serial_
=A0=A0=A0=A0=A0=A0=A0=A0int port_type;
=A0=A0=A0=A0=A0=A0=A0=A0int ret;
=A0
+=A0=A0=A0=A0=A0=A0=A0if (!of_device_is_available(ofdev->node)) {
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0dev_info(&ofdev->dev, "Disa=
bled serial port. =A0Ignored\n");
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return -ENODEV;
+=A0=A0=A0=A0=A0=A0=A0}
+
=A0=A0=A0=A0=A0=A0=A0=A0if (of_find_property(ofdev->node, "used-by-rtas",=
 NULL))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return -EBUSY;
I wonder whether we should move the check for "used-by-rtas" into the
of_device_is_available function. I understand that used-by-rtas is
another way of expressing the idea that the kernel is not supposed to
access the specific device. In this case, the device is physically
present, but is not available to the OS.

	Arnd <><

Re: [PATCH 2/2 v2] [POWERPC] Ignore disabled serial ports

From: Josh Boyer <hidden>
Date: 2008-03-03 04:45:45

On Mon, 3 Mar 2008 04:43:42 +0100
Arnd Bergmann [off-list ref] wrote:
On Saturday 01 March 2008, Josh Boyer wrote:
quoted
--- linux-2.6.orig/drivers/serial/of_serial.c
+++ linux-2.6/drivers/serial/of_serial.c
@@ -72,6 +72,11 @@ static int __devinit of_platform_serial_
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int port_type;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int ret;
=C2=A0
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (!of_device_is_available(=
ofdev->node)) {
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0dev_info(&ofdev->dev, "Disabled serial port. =C2=A0Ign=
ored\n");
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0return -ENODEV;
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}
+
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (of_find_property(of=
dev->node, "used-by-rtas", NULL))
quoted
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0return -EBUSY;
=20
I wonder whether we should move the check for "used-by-rtas" into the
of_device_is_available function. I understand that used-by-rtas is
another way of expressing the idea that the kernel is not supposed to
access the specific device. In this case, the device is physically
present, but is not available to the OS.
I'd rather not at the moment.  My intention was to only look at the
status property for now.  I'd like to avoid this function growing into
a huge switch statement for $random_firmware's way of flagging
something as "don't touch".

josh

Re: [PATCH 2/2 v2] [POWERPC] Ignore disabled serial ports

From: Scott Wood <hidden>
Date: 2008-03-03 19:14:43

On Sun, Mar 02, 2008 at 10:43:17PM -0600, Josh Boyer wrote:
On Mon, 3 Mar 2008 04:43:42 +0100
Arnd Bergmann [off-list ref] wrote:
quoted
I wonder whether we should move the check for "used-by-rtas" into the
of_device_is_available function. I understand that used-by-rtas is
another way of expressing the idea that the kernel is not supposed to
access the specific device. In this case, the device is physically
present, but is not available to the OS.
I'd rather not at the moment.  My intention was to only look at the
status property for now.  I'd like to avoid this function growing into
a huge switch statement for $random_firmware's way of flagging
something as "don't touch".
Better that than having the "huge" list of tests in every driver...

-Scott

Re: [PATCH 2/2 v2] [POWERPC] Ignore disabled serial ports

From: Josh Boyer <hidden>
Date: 2008-03-03 19:21:14

On Mon, 3 Mar 2008 13:09:25 -0600
Scott Wood [off-list ref] wrote:
On Sun, Mar 02, 2008 at 10:43:17PM -0600, Josh Boyer wrote:
quoted
On Mon, 3 Mar 2008 04:43:42 +0100
Arnd Bergmann [off-list ref] wrote:
quoted
I wonder whether we should move the check for "used-by-rtas" into the
of_device_is_available function. I understand that used-by-rtas is
another way of expressing the idea that the kernel is not supposed to
access the specific device. In this case, the device is physically
present, but is not available to the OS.
I'd rather not at the moment.  My intention was to only look at the
status property for now.  I'd like to avoid this function growing into
a huge switch statement for $random_firmware's way of flagging
something as "don't touch".
Better that than having the "huge" list of tests in every driver...
Perhaps.

This isn't set in stone.  I'd rather get what's in the patch in-tree
now and massage it as we go.  Otherwise this bike shed will wind up
being rainbow colored yet totally useless because it's a never-ending
patch rework.

josh

Re: [PATCH 2/2 v2] [POWERPC] Ignore disabled serial ports

From: Nathan Lynch <hidden>
Date: 2008-03-03 21:40:52

Josh Boyer wrote:
On Mon, 3 Mar 2008 13:09:25 -0600
Scott Wood [off-list ref] wrote:
quoted
On Sun, Mar 02, 2008 at 10:43:17PM -0600, Josh Boyer wrote:
quoted
On Mon, 3 Mar 2008 04:43:42 +0100
Arnd Bergmann [off-list ref] wrote:
quoted
I wonder whether we should move the check for "used-by-rtas" into the
of_device_is_available function. I understand that used-by-rtas is
another way of expressing the idea that the kernel is not supposed to
access the specific device. In this case, the device is physically
present, but is not available to the OS.
I'd rather not at the moment.  My intention was to only look at the
status property for now.  I'd like to avoid this function growing into
a huge switch statement for $random_firmware's way of flagging
something as "don't touch".
Better that than having the "huge" list of tests in every driver...
Perhaps.

This isn't set in stone.  I'd rather get what's in the patch in-tree
now and massage it as we go.  Otherwise this bike shed will wind up
being rainbow colored yet totally useless because it's a never-ending
patch rework.
I agree.  Josh's patch is immediately useful to other code as-is.

used-by-rtas is powerpc-specific and doesn't belong in drivers/of IMO.

Re: [PATCH 2/2 v2] [POWERPC] Ignore disabled serial ports

From: Arnd Bergmann <arnd@arndb.de>
Date: 2008-03-04 00:42:21

On Monday 03 March 2008, Nathan Lynch wrote:
I agree. =A0Josh's patch is immediately useful to other code as-is.
=20
used-by-rtas is powerpc-specific and doesn't belong in drivers/of IMO.
Ok, makes sense, plus paulus looked at the PAPR spec with me and we found
that used-by-rtas doesn't necessarily mean "don't touch" in all
circumstances, so original patch

Acked-by: Arnd Bergmann <arnd@arndb.de>

Re: [RESEND] [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Paul Mackerras <hidden>
Date: 2008-03-24 11:39:18

Josh Boyer writes:
This adds a function called of_device_is_available that checks the state
of the status property of a device.  If the property is absent or set to
either "okay" or "ok", it returns 1.  Otherwise it returns 0.
Well actually...
quoted hunk
+	if (statlen > 0) {
+		if (!strncmp(status, "okay", 4) || !strncmp(status, "ok", 2))
+			return 1;
The second test will succeed for anything that starts with "ok", so
the first test is redundant.  I suspect you want strcmp instead of
strncmp in both tests.

Paul.

Re: [RESEND] [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Josh Boyer <hidden>
Date: 2008-03-24 11:47:41

On Mon, 24 Mar 2008 22:39:18 +1100
Paul Mackerras [off-list ref] wrote:
Josh Boyer writes:
quoted
This adds a function called of_device_is_available that checks the state
of the status property of a device.  If the property is absent or set to
either "okay" or "ok", it returns 1.  Otherwise it returns 0.
Well actually...
quoted
+	if (statlen > 0) {
+		if (!strncmp(status, "okay", 4) || !strncmp(status, "ok", 2))
+			return 1;
The second test will succeed for anything that starts with "ok", so
the first test is redundant.  I suspect you want strcmp instead of
strncmp in both tests.
GRR!  That's what I had in the original patch and you told me to use
strncmp instead.

If you want I can send out a v3.  Otherwise, perhaps you could just
munge the patch?

josh

Re: [RESEND] [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Sean MacLennan <hidden>
Date: 2008-03-25 04:47:56

On Mon, 24 Mar 2008 22:39:18 +1100
"Paul Mackerras" [off-list ref] wrote:
The second test will succeed for anything that starts with "ok", so
the first test is redundant.  I suspect you want strcmp instead of
strncmp in both tests.
I like the strncmp(status, "ok", 2). Then you can have a status of
okey-dokey ;)

Cheers,
   Sean

Re: [RESEND] [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Josh Boyer <hidden>
Date: 2008-03-25 11:54:22

On Tue, 25 Mar 2008 00:47:53 -0400
Sean MacLennan [off-list ref] wrote:
On Mon, 24 Mar 2008 22:39:18 +1100
"Paul Mackerras" [off-list ref] wrote:
quoted
The second test will succeed for anything that starts with "ok", so
the first test is redundant.  I suspect you want strcmp instead of
strncmp in both tests.
I like the strncmp(status, "ok", 2). Then you can have a status of
okey-dokey ;)
You can also have "oklahoma", "okaly-dokaly-do" (I hate Ned Flanders),
and "ok-this-device-is-fubar-don't-ever-touch-it!"

We really want just "okay" and "ok".  Look for a version 3 of the patch
that fixes it later today.

josh

Re: [RESEND] [PATCH 1/2 v2] [OF] Add of_device_is_available function

From: Segher Boessenkool <hidden>
Date: 2008-03-26 14:29:42

We really want just "okay" and "ok".  Look for a version 3 of the patch
that fixes it later today.
You might want to put in a comment that says "ok" is only a
workaround for some broken systems, too.


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help