From: Al Stone al.stone@linaro.org
As a way to test out the concepts and implementation, start converting the existing vexpress-sysreg driver so that it uses the GUFI. The intent is to (a) act as a test for the idea, and (b) be very clear on how extensive (or not) the changes actually are. The goal is to make it so the changes can be done almost entirely with a sed script.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/mfd/vexpress-sysreg.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c index 31f60ff..3e7e4d3 100644 --- a/drivers/mfd/vexpress-sysreg.c +++ b/drivers/mfd/vexpress-sysreg.c @@ -15,14 +15,13 @@ #include <linux/gpio.h> #include <linux/io.h> #include <linux/leds.h> -#include <linux/of_address.h> +#include <linux/gufi.h> #include <linux/platform_device.h> #include <linux/regulator/driver.h> #include <linux/slab.h> #include <linux/stat.h> #include <linux/timer.h> #include <linux/vexpress.h> -#include <linux/acpi.h>
#define SYS_ID 0x000 #define SYS_SW 0x004 @@ -118,9 +117,11 @@ void __iomem *vexpress_get_24mhz_clock_base(void) static void vexpress_sysreg_find_prop(struct device_node *node, const char *name, u32 *val) { + /* BOZO: should be gufi_node_get(node); */ of_node_get(node); while (node) { if (of_property_read_u32(node, name, val) == 0) { + /* BOZO: should be gufi_node_put(node); */ of_node_put(node); return; } @@ -339,15 +340,16 @@ void __init vexpress_sysreg_early_init(void __iomem *base)
void __init vexpress_sysreg_of_early_init(void) { - struct device_node *node; + struct gufi_device_node *node;
if (vexpress_sysreg_base) return;
- node = of_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg"); + node = gufi_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg"); if (node) { - vexpress_sysreg_base = of_iomap(node, 0); - vexpress_sysreg_setup(node); + vexpress_sysreg_base = gufi_iomap(node, 0); + /* BOZO: was vexpress_sysreg_setup(node); */ + vexpress_sysreg_setup(node->dn); } }