Commit e9fae189 authored by Michael Hennerich's avatar Michael Hennerich Committed by Bryan Wu

Blackfin arch: Fix bogus str_ident check in gpio code

Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 46aa04f9
...@@ -238,7 +238,7 @@ static void gpio_error(unsigned gpio) ...@@ -238,7 +238,7 @@ static void gpio_error(unsigned gpio)
static void set_label(unsigned short ident, const char *label) static void set_label(unsigned short ident, const char *label)
{ {
if (label && str_ident) { if (label) {
strncpy(str_ident[ident].name, label, strncpy(str_ident[ident].name, label,
RESOURCE_LABEL_SIZE); RESOURCE_LABEL_SIZE);
str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0; str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0;
...@@ -247,9 +247,6 @@ static void set_label(unsigned short ident, const char *label) ...@@ -247,9 +247,6 @@ static void set_label(unsigned short ident, const char *label)
static char *get_label(unsigned short ident) static char *get_label(unsigned short ident)
{ {
if (!str_ident)
return "UNKNOWN";
return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN"); return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN");
} }
...@@ -260,7 +257,7 @@ static int cmp_label(unsigned short ident, const char *label) ...@@ -260,7 +257,7 @@ static int cmp_label(unsigned short ident, const char *label)
printk(KERN_ERR "Please provide none-null label\n"); printk(KERN_ERR "Please provide none-null label\n");
} }
if (label && str_ident) if (label)
return strncmp(str_ident[ident].name, return strncmp(str_ident[ident].name,
label, strlen(label)); label, strlen(label));
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment