static struct bus_id_priv busid_table[MAX_BUSID];
static spinlock_t busid_table_lock;
+static void init_busid_table(void)
+{
+ int i;
+
+ for (i = 0; i < MAX_BUSID; i++) {
+ memset(busid_table[i].name, 0, BUSID_SIZE);
+ busid_table[i].status = STUB_BUSID_OTHER;
+ busid_table[i].interf_count = 0;
+ busid_table[i].sdev = NULL;
+ busid_table[i].shutdown_busid = 0;
+ }
+
+ spin_lock_init(&busid_table_lock);
+}
+
int match_busid(const char *busid)
{
int i;
return NULL;
}
-static ssize_t show_match_busid(struct device_driver *drv, char *buf)
-{
- int i;
- char *out = buf;
-
- spin_lock(&busid_table_lock);
- for (i = 0; i < MAX_BUSID; i++)
- if (busid_table[i].name[0])
- out += sprintf(out, "%s ", busid_table[i].name);
- spin_unlock(&busid_table_lock);
-
- out += sprintf(out, "\n");
- return out - buf;
-}
-
static int add_match_busid(char *busid)
{
int i;
return -1;
}
-static void init_busid_table(void)
+static ssize_t show_match_busid(struct device_driver *drv, char *buf)
{
int i;
+ char *out = buf;
- for (i = 0; i < MAX_BUSID; i++) {
- memset(busid_table[i].name, 0, BUSID_SIZE);
- busid_table[i].status = STUB_BUSID_OTHER;
- busid_table[i].interf_count = 0;
- busid_table[i].sdev = NULL;
- busid_table[i].shutdown_busid = 0;
- }
+ spin_lock(&busid_table_lock);
+ for (i = 0; i < MAX_BUSID; i++)
+ if (busid_table[i].name[0])
+ out += sprintf(out, "%s ", busid_table[i].name);
+ spin_unlock(&busid_table_lock);
- spin_lock_init(&busid_table_lock);
+ out += sprintf(out, "\n");
+ return out - buf;
}
static ssize_t store_match_busid(struct device_driver *dev, const char *buf,