Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249376
b: refs/heads/master
c: 6c033b4
h: refs/heads/master
v: v3
  • Loading branch information
matt mooney authored and Greg Kroah-Hartman committed May 6, 2011
1 parent 939c106 commit a98fc3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b744a45f45e3d18db91b33d1ac45597ddc2ea71c
refs/heads/master: 6c033b46ce3a7820d567fdb6e03128ca75468d11
19 changes: 6 additions & 13 deletions trunk/drivers/staging/usbip/stub_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct kmem_cache *stub_priv_cache;

/* Define sysfs entries for the usbip driver */


/*
* busid_tables defines matching busids that usbip can grab. A user can change
* dynamically what device is locally used and what device is exported to a
Expand All @@ -44,7 +43,6 @@ struct kmem_cache *stub_priv_cache;
static struct bus_id_priv busid_table[MAX_BUSID];
static spinlock_t busid_table_lock;


int match_busid(const char *busid)
{
int i;
Expand Down Expand Up @@ -148,23 +146,24 @@ int del_match_busid(char *busid)

return -1;
}

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);
}

static ssize_t store_match_busid(struct device_driver *dev, const char *buf,
size_t count)
size_t count)
{
int len;
char busid[BUSID_SIZE];
Expand All @@ -181,7 +180,6 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf,

strncpy(busid, buf + 4, BUSID_SIZE);


if (!strncmp(buf, "add ", 4)) {
if (add_match_busid(busid) < 0)
return -ENOMEM;
Expand All @@ -199,11 +197,8 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf,
} else
return -EINVAL;
}

static DRIVER_ATTR(match_busid, S_IRUSR|S_IWUSR, show_match_busid,
store_match_busid);


store_match_busid);

/*-------------------------------------------------------------------------*/

Expand Down Expand Up @@ -265,14 +260,12 @@ void stub_device_cleanup_urbs(struct stub_device *sdev)
kmem_cache_free(stub_priv_cache, priv);

kfree(urb->transfer_buffer);

kfree(urb->setup_packet);

usb_free_urb(urb);
}
}


/*-------------------------------------------------------------------------*/

static int __init usb_stub_init(void)
Expand All @@ -296,8 +289,8 @@ static int __init usb_stub_init(void)
goto error_usb_register;
}

printk(KERN_INFO KBUILD_MODNAME ":"
DRIVER_DESC ":" DRIVER_VERSION "\n");
printk(KERN_INFO KBUILD_MODNAME ":" DRIVER_DESC ":" DRIVER_VERSION
"\n");

init_busid_table();

Expand Down

0 comments on commit a98fc3e

Please sign in to comment.