linux-stable/drivers/of
Grant Likely 594fa265e0 of/gpio: stop using device_node data pointer to find gpio_chip
Currently the kernel uses the struct device_node.data pointer to resolve
a struct gpio_chip pointer from a device tree node.  However, the .data
member doesn't provide any type checking and there aren't any rules
enforced on what it should be used for.  There's no guarantee that the
data stored in it actually points to an gpio_chip pointer.

Instead of relying on the .data pointer, this patch modifies the code
to add a lookup function which scans through the registered gpio_chips
and returns the gpio_chip that has a pointer to the specified
device_node.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Anton Vorontsov <avorontsov@ru.mvista.com>
CC: Grant Likely <grant.likely@secretlab.ca>
CC: David Brownell <dbrownell@users.sourceforge.net>
CC: Bill Gatliff <bgat@billgatliff.com>
CC: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Jean Delvare <khali@linux-fr.org>
CC: linux-kernel@vger.kernel.org
CC: devicetree-discuss@lists.ozlabs.org
2010-07-05 16:14:30 -06:00
..
address.c of: Use full node name in resource structures 2010-07-05 16:14:27 -06:00
base.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
device.c of: Modify of_device_get_modalias to be passed struct device 2010-07-05 16:14:28 -06:00
fdt.c of/flattree: Make unflatten_device_tree() safe to call from any arch 2010-04-28 18:20:29 -06:00
gpio.c of/gpio: stop using device_node data pointer to find gpio_chip 2010-07-05 16:14:30 -06:00
irq.c of: Use full node name in resource structures 2010-07-05 16:14:27 -06:00
Kconfig of/address: merge of_iomap() 2010-07-05 16:14:26 -06:00
Makefile of/address: merge of_iomap() 2010-07-05 16:14:26 -06:00
of_i2c.c of: eliminate of_device->node and dev_archdata->{of,prom}_node 2010-05-18 16:10:45 -06:00
of_mdio.c of/irq: Move irq_of_parse_and_map() to common code 2010-06-28 12:41:33 -07:00
of_spi.c of/irq: Move irq_of_parse_and_map() to common code 2010-06-28 12:41:33 -07:00
platform.c of/device: populate platform_device (of_device) resource table on allocation 2010-07-05 16:14:29 -06:00