aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-10-12 23:35:22 -0400
committerBryan Wu <cooloney@kernel.org>2008-10-12 23:35:22 -0400
commite9fae189caae7c1cf306e30f5b67c6d226ed69cf (patch)
tree059ece3216ac9c01b943e41b059f26c6ff577685 /arch/blackfin/kernel
parent46aa04f9b678d1d6f3558429109326775ca87715 (diff)
Blackfin arch: Fix bogus str_ident check in gpio code
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 12710ed180be..6e08f425bb44 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -238,7 +238,7 @@ static void gpio_error(unsigned gpio)
238 238
239static void set_label(unsigned short ident, const char *label) 239static void set_label(unsigned short ident, const char *label)
240{ 240{
241 if (label && str_ident) { 241 if (label) {
242 strncpy(str_ident[ident].name, label, 242 strncpy(str_ident[ident].name, label,
243 RESOURCE_LABEL_SIZE); 243 RESOURCE_LABEL_SIZE);
244 str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0; 244 str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0;
@@ -247,9 +247,6 @@ static void set_label(unsigned short ident, const char *label)
247 247
248static char *get_label(unsigned short ident) 248static char *get_label(unsigned short ident)
249{ 249{
250 if (!str_ident)
251 return "UNKNOWN";
252
253 return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN"); 250 return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN");
254} 251}
255 252
@@ -260,7 +257,7 @@ static int cmp_label(unsigned short ident, const char *label)
260 printk(KERN_ERR "Please provide none-null label\n"); 257 printk(KERN_ERR "Please provide none-null label\n");
261 } 258 }
262 259
263 if (label && str_ident) 260 if (label)
264 return strncmp(str_ident[ident].name, 261 return strncmp(str_ident[ident].name,
265 label, strlen(label)); 262 label, strlen(label));
266 else 263 else