aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon/mon_main.c
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2007-05-03 19:51:16 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:29:47 -0400
commitce7cd137fced114d49178b73d468b82096a107fb (patch)
treedfc1f49df82d6ec3b301d786e79ae9481dcc83dd /drivers/usb/mon/mon_main.c
parent49cdee0ed0fce9e1bda81f5dcad8d5cce6aec983 (diff)
usbmon: Add class for binary interface
Add a class which allows for an easier integration with udev. This code was originally written by Paolo Abeni, and arrived to my tree as a part of big patch to add binary API on December 18. As I understand, Paolo always meant the class to be a part of the whole thing. This is his udev rule to go along with the patch: KERNEL=="usbmon[0-9]*", NAME="usbmon%n", MODE="0440",OWNER="root",GROUP="bin" Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/mon/mon_main.c')
-rw-r--r--drivers/usb/mon/mon_main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c
index 8977ec0d0f99..ce61d8b0fd86 100644
--- a/drivers/usb/mon/mon_main.c
+++ b/drivers/usb/mon/mon_main.c
@@ -220,6 +220,8 @@ static void mon_bus_remove(struct usb_bus *ubus)
220 list_del(&mbus->bus_link); 220 list_del(&mbus->bus_link);
221 if (mbus->text_inited) 221 if (mbus->text_inited)
222 mon_text_del(mbus); 222 mon_text_del(mbus);
223 if (mbus->bin_inited)
224 mon_bin_del(mbus);
223 225
224 mon_dissolve(mbus, ubus); 226 mon_dissolve(mbus, ubus);
225 kref_put(&mbus->ref, mon_bus_drop); 227 kref_put(&mbus->ref, mon_bus_drop);
@@ -301,8 +303,8 @@ static void mon_bus_init(struct usb_bus *ubus)
301 mbus->u_bus = ubus; 303 mbus->u_bus = ubus;
302 ubus->mon_bus = mbus; 304 ubus->mon_bus = mbus;
303 305
304 mbus->text_inited = mon_text_add(mbus, ubus->busnum); 306 mbus->text_inited = mon_text_add(mbus, ubus);
305 // mon_bin_add(...) 307 mbus->bin_inited = mon_bin_add(mbus, ubus);
306 308
307 mutex_lock(&mon_lock); 309 mutex_lock(&mon_lock);
308 list_add_tail(&mbus->bus_link, &mon_buses); 310 list_add_tail(&mbus->bus_link, &mon_buses);
@@ -321,8 +323,8 @@ static void mon_bus0_init(void)
321 spin_lock_init(&mbus->lock); 323 spin_lock_init(&mbus->lock);
322 INIT_LIST_HEAD(&mbus->r_list); 324 INIT_LIST_HEAD(&mbus->r_list);
323 325
324 mbus->text_inited = mon_text_add(mbus, 0); 326 mbus->text_inited = mon_text_add(mbus, NULL);
325 // mbus->bin_inited = mon_bin_add(mbus, 0); 327 mbus->bin_inited = mon_bin_add(mbus, NULL);
326} 328}
327 329
328/* 330/*
@@ -403,6 +405,8 @@ static void __exit mon_exit(void)
403 405
404 if (mbus->text_inited) 406 if (mbus->text_inited)
405 mon_text_del(mbus); 407 mon_text_del(mbus);
408 if (mbus->bin_inited)
409 mon_bin_del(mbus);
406 410
407 /* 411 /*
408 * This never happens, because the open/close paths in 412 * This never happens, because the open/close paths in
@@ -423,6 +427,8 @@ static void __exit mon_exit(void)
423 mbus = &mon_bus0; 427 mbus = &mon_bus0;
424 if (mbus->text_inited) 428 if (mbus->text_inited)
425 mon_text_del(mbus); 429 mon_text_del(mbus);
430 if (mbus->bin_inited)
431 mon_bin_del(mbus);
426 432
427 mutex_unlock(&mon_lock); 433 mutex_unlock(&mon_lock);
428 434