alistair23-linux/drivers/of
Xiubo Li 42ccd781bb of: Fix __of_device_is_available check
From IEEE 1275, there defined a standard 'status' property indicating the
operational status of one device. The 'status' property has four possible
values: 'okay/ok', 'disabled', 'fail' and 'fail-xxx'.

If it is absent, that means the status of the device is unknown or okay.

The __of_device_is_available checks the state of the 'status' property of
a device. If the property is absent or set to 'okay/ok', it returns 1.
Otherwise it returns 0.

While in __of_device_is_available:
 >	status = of_get_property(device, "status", &statlen);
 >	if (status == NULL)
 >		return 1;
The status value returned from 'of_get_property()' will be NULL in two cases:
Firstly: the 'device' value (device node) is NULL.
Secondly: the 'status' property is actaully not exist.

If the device node is NULL, the __of_device_is_available will return true,
that will mean the absent state of the 'status' property.

So this add the device node check before checking the 'status' property's
state, and if the device node is not exist, 0 will be returned.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
2014-01-16 17:29:24 +00:00
..
address.c Revert "of/address: Handle #address-cells > 2 specially" 2013-12-30 10:22:41 -06:00
base.c of: Fix __of_device_is_available check 2014-01-16 17:29:24 +00:00
device.c
fdt.c of: Fix NULL dereference in unflatten_and_copy() 2013-12-11 13:40:30 +00:00
irq.c of/irq: Fix device_node refcount in of_irq_parse_raw() 2013-12-30 10:23:27 -06:00
Kconfig of/Kconfig: Spelling s/one/once/ 2013-12-30 10:23:25 -06:00
Makefile Revert "drivers: of: add initialization code for dma reserved memory" 2013-10-15 09:26:07 +01:00
of_mdio.c net: of_mdio: fix behavior on missing phy device 2013-05-08 13:13:29 -07:00
of_mtd.c
of_net.c of: Make of_get_phy_mode() return int i.s.o. const int 2013-08-28 20:50:19 +01:00
of_pci.c of: implement pci_address_to_pio as weak function 2013-10-09 20:04:06 -05:00
of_pci_irq.c Merge remote-tracking branch 'grant/devicetree/next' into for-next 2013-11-07 10:34:46 -06:00
of_private.h
pdt.c of: remove unnecessary prom.h includes 2013-10-09 20:03:59 -05:00
platform.c Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
selftest.c of/irq: create interrupts-extended property 2013-10-28 16:48:14 -07:00