From a8bf35d931bcf24237a6f49d01309e86548a863b Mon Sep 17 00:00:00 2001 From: John Linn Date: Fri, 5 Jun 2009 11:36:31 -0600 Subject: [PATCH] --- yaml --- r: 176132 b: refs/heads/master c: 6d858535be59b220c0f8dc335e030c2e3f3a3032 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/microblaze/kernel/heartbeat.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 868d871ff9a9..5a6758201f91 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 95dfbbe4700016bddd7e8915e95a97652e70f495 +refs/heads/master: 6d858535be59b220c0f8dc335e030c2e3f3a3032 diff --git a/trunk/arch/microblaze/kernel/heartbeat.c b/trunk/arch/microblaze/kernel/heartbeat.c index 1bdf20222b92..522751737cfa 100644 --- a/trunk/arch/microblaze/kernel/heartbeat.c +++ b/trunk/arch/microblaze/kernel/heartbeat.c @@ -45,6 +45,7 @@ void heartbeat(void) void setup_heartbeat(void) { struct device_node *gpio = NULL; + int *prop; int j; char *gpio_list[] = { "xlnx,xps-gpio-1.00.a", @@ -58,10 +59,14 @@ void setup_heartbeat(void) break; } - base_addr = *(int *) of_get_property(gpio, "reg", NULL); - base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); - printk(KERN_NOTICE "Heartbeat GPIO at 0x%x\n", base_addr); + if (gpio) { + base_addr = *(int *) of_get_property(gpio, "reg", NULL); + base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE); + printk(KERN_NOTICE "Heartbeat GPIO at 0x%x\n", base_addr); - if (*(int *) of_get_property(gpio, "xlnx,is-bidir", NULL)) - out_be32(base_addr + 4, 0); /* GPIO is configured as output */ + /* GPIO is configured as output */ + prop = (int *) of_get_property(gpio, "xlnx,is-bidir", NULL); + if (prop) + out_be32(base_addr + 4, 0); + } }