diff options
author | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
commit | bac30d1a78d0f11c613968fc8b351a91ed465386 (patch) | |
tree | e52f3c876522a2f6047a6ec1c27df2e8a79486b8 /drivers/usb | |
parent | e8222502ee6157e2713da9e0792c21f4ad458d50 (diff) | |
parent | ca9ba4471c1203bb6e759b76e83167fec54fe590 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/file.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/notify.c | 65 | ||||
-rw-r--r-- | drivers/usb/gadget/inode.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ohci-s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/usb/net/zaurus.c | 2 |
5 files changed, 16 insertions, 65 deletions
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 37b13368c81..b263a54a13c 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -24,15 +24,15 @@ | |||
24 | #include "usb.h" | 24 | #include "usb.h" |
25 | 25 | ||
26 | #define MAX_USB_MINORS 256 | 26 | #define MAX_USB_MINORS 256 |
27 | static struct file_operations *usb_minors[MAX_USB_MINORS]; | 27 | static const struct file_operations *usb_minors[MAX_USB_MINORS]; |
28 | static DEFINE_SPINLOCK(minor_lock); | 28 | static DEFINE_SPINLOCK(minor_lock); |
29 | 29 | ||
30 | static int usb_open(struct inode * inode, struct file * file) | 30 | static int usb_open(struct inode * inode, struct file * file) |
31 | { | 31 | { |
32 | int minor = iminor(inode); | 32 | int minor = iminor(inode); |
33 | struct file_operations *c; | 33 | const struct file_operations *c; |
34 | int err = -ENODEV; | 34 | int err = -ENODEV; |
35 | struct file_operations *old_fops, *new_fops = NULL; | 35 | const struct file_operations *old_fops, *new_fops = NULL; |
36 | 36 | ||
37 | spin_lock (&minor_lock); | 37 | spin_lock (&minor_lock); |
38 | c = usb_minors[minor]; | 38 | c = usb_minors[minor]; |
diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c index 4b55285de9a..fe0ed54fa0a 100644 --- a/drivers/usb/core/notify.c +++ b/drivers/usb/core/notify.c | |||
@@ -16,57 +16,7 @@ | |||
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include "usb.h" | 17 | #include "usb.h" |
18 | 18 | ||
19 | 19 | static BLOCKING_NOTIFIER_HEAD(usb_notifier_list); | |
20 | static struct notifier_block *usb_notifier_list; | ||
21 | static DEFINE_MUTEX(usb_notifier_lock); | ||
22 | |||
23 | static void usb_notifier_chain_register(struct notifier_block **list, | ||
24 | struct notifier_block *n) | ||
25 | { | ||
26 | mutex_lock(&usb_notifier_lock); | ||
27 | while (*list) { | ||
28 | if (n->priority > (*list)->priority) | ||
29 | break; | ||
30 | list = &((*list)->next); | ||
31 | } | ||
32 | n->next = *list; | ||
33 | *list = n; | ||
34 | mutex_unlock(&usb_notifier_lock); | ||
35 | } | ||
36 | |||
37 | static void usb_notifier_chain_unregister(struct notifier_block **nl, | ||
38 | struct notifier_block *n) | ||
39 | { | ||
40 | mutex_lock(&usb_notifier_lock); | ||
41 | while ((*nl)!=NULL) { | ||
42 | if ((*nl)==n) { | ||
43 | *nl = n->next; | ||
44 | goto exit; | ||
45 | } | ||
46 | nl=&((*nl)->next); | ||
47 | } | ||
48 | exit: | ||
49 | mutex_unlock(&usb_notifier_lock); | ||
50 | } | ||
51 | |||
52 | static int usb_notifier_call_chain(struct notifier_block **n, | ||
53 | unsigned long val, void *v) | ||
54 | { | ||
55 | int ret=NOTIFY_DONE; | ||
56 | struct notifier_block *nb = *n; | ||
57 | |||
58 | mutex_lock(&usb_notifier_lock); | ||
59 | while (nb) { | ||
60 | ret = nb->notifier_call(nb,val,v); | ||
61 | if (ret&NOTIFY_STOP_MASK) { | ||
62 | goto exit; | ||
63 | } | ||
64 | nb = nb->next; | ||
65 | } | ||
66 | exit: | ||
67 | mutex_unlock(&usb_notifier_lock); | ||
68 | return ret; | ||
69 | } | ||
70 | 20 | ||
71 | /** | 21 | /** |
72 | * usb_register_notify - register a notifier callback whenever a usb change happens | 22 | * usb_register_notify - register a notifier callback whenever a usb change happens |
@@ -76,7 +26,7 @@ exit: | |||
76 | */ | 26 | */ |
77 | void usb_register_notify(struct notifier_block *nb) | 27 | void usb_register_notify(struct notifier_block *nb) |
78 | { | 28 | { |
79 | usb_notifier_chain_register(&usb_notifier_list, nb); | 29 | blocking_notifier_chain_register(&usb_notifier_list, nb); |
80 | } | 30 | } |
81 | EXPORT_SYMBOL_GPL(usb_register_notify); | 31 | EXPORT_SYMBOL_GPL(usb_register_notify); |
82 | 32 | ||
@@ -89,27 +39,28 @@ EXPORT_SYMBOL_GPL(usb_register_notify); | |||
89 | */ | 39 | */ |
90 | void usb_unregister_notify(struct notifier_block *nb) | 40 | void usb_unregister_notify(struct notifier_block *nb) |
91 | { | 41 | { |
92 | usb_notifier_chain_unregister(&usb_notifier_list, nb); | 42 | blocking_notifier_chain_unregister(&usb_notifier_list, nb); |
93 | } | 43 | } |
94 | EXPORT_SYMBOL_GPL(usb_unregister_notify); | 44 | EXPORT_SYMBOL_GPL(usb_unregister_notify); |
95 | 45 | ||
96 | 46 | ||
97 | void usb_notify_add_device(struct usb_device *udev) | 47 | void usb_notify_add_device(struct usb_device *udev) |
98 | { | 48 | { |
99 | usb_notifier_call_chain(&usb_notifier_list, USB_DEVICE_ADD, udev); | 49 | blocking_notifier_call_chain(&usb_notifier_list, USB_DEVICE_ADD, udev); |
100 | } | 50 | } |
101 | 51 | ||
102 | void usb_notify_remove_device(struct usb_device *udev) | 52 | void usb_notify_remove_device(struct usb_device *udev) |
103 | { | 53 | { |
104 | usb_notifier_call_chain(&usb_notifier_list, USB_DEVICE_REMOVE, udev); | 54 | blocking_notifier_call_chain(&usb_notifier_list, |
55 | USB_DEVICE_REMOVE, udev); | ||
105 | } | 56 | } |
106 | 57 | ||
107 | void usb_notify_add_bus(struct usb_bus *ubus) | 58 | void usb_notify_add_bus(struct usb_bus *ubus) |
108 | { | 59 | { |
109 | usb_notifier_call_chain(&usb_notifier_list, USB_BUS_ADD, ubus); | 60 | blocking_notifier_call_chain(&usb_notifier_list, USB_BUS_ADD, ubus); |
110 | } | 61 | } |
111 | 62 | ||
112 | void usb_notify_remove_bus(struct usb_bus *ubus) | 63 | void usb_notify_remove_bus(struct usb_bus *ubus) |
113 | { | 64 | { |
114 | usb_notifier_call_chain(&usb_notifier_list, USB_BUS_REMOVE, ubus); | 65 | blocking_notifier_call_chain(&usb_notifier_list, USB_BUS_REMOVE, ubus); |
115 | } | 66 | } |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index b44cfda76b6..3f618ce6998 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -1581,7 +1581,7 @@ restart: | |||
1581 | 1581 | ||
1582 | static struct inode * | 1582 | static struct inode * |
1583 | gadgetfs_create_file (struct super_block *sb, char const *name, | 1583 | gadgetfs_create_file (struct super_block *sb, char const *name, |
1584 | void *data, struct file_operations *fops, | 1584 | void *data, const struct file_operations *fops, |
1585 | struct dentry **dentry_p); | 1585 | struct dentry **dentry_p); |
1586 | 1586 | ||
1587 | static int activate_ep_files (struct dev_data *dev) | 1587 | static int activate_ep_files (struct dev_data *dev) |
@@ -1955,7 +1955,7 @@ module_param (default_perm, uint, 0644); | |||
1955 | 1955 | ||
1956 | static struct inode * | 1956 | static struct inode * |
1957 | gadgetfs_make_inode (struct super_block *sb, | 1957 | gadgetfs_make_inode (struct super_block *sb, |
1958 | void *data, struct file_operations *fops, | 1958 | void *data, const struct file_operations *fops, |
1959 | int mode) | 1959 | int mode) |
1960 | { | 1960 | { |
1961 | struct inode *inode = new_inode (sb); | 1961 | struct inode *inode = new_inode (sb); |
@@ -1979,7 +1979,7 @@ gadgetfs_make_inode (struct super_block *sb, | |||
1979 | */ | 1979 | */ |
1980 | static struct inode * | 1980 | static struct inode * |
1981 | gadgetfs_create_file (struct super_block *sb, char const *name, | 1981 | gadgetfs_create_file (struct super_block *sb, char const *name, |
1982 | void *data, struct file_operations *fops, | 1982 | void *data, const struct file_operations *fops, |
1983 | struct dentry **dentry_p) | 1983 | struct dentry **dentry_p) |
1984 | { | 1984 | { |
1985 | struct dentry *dentry; | 1985 | struct dentry *dentry; |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 372527a8359..682bf221566 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -158,7 +158,7 @@ static int ohci_s3c2410_hub_control ( | |||
158 | "s3c2410_hub_control(%p,0x%04x,0x%04x,0x%04x,%p,%04x)\n", | 158 | "s3c2410_hub_control(%p,0x%04x,0x%04x,0x%04x,%p,%04x)\n", |
159 | hcd, typeReq, wValue, wIndex, buf, wLength); | 159 | hcd, typeReq, wValue, wIndex, buf, wLength); |
160 | 160 | ||
161 | /* if we are only an humble host without any special capabilites | 161 | /* if we are only an humble host without any special capabilities |
162 | * process the request straight away and exit */ | 162 | * process the request straight away and exit */ |
163 | 163 | ||
164 | if (info == NULL) { | 164 | if (info == NULL) { |
diff --git a/drivers/usb/net/zaurus.c b/drivers/usb/net/zaurus.c index 9c5ab251370..f7ac9d6b985 100644 --- a/drivers/usb/net/zaurus.c +++ b/drivers/usb/net/zaurus.c | |||
@@ -217,7 +217,7 @@ static int blan_mdlm_bind(struct usbnet *dev, struct usb_interface *intf) | |||
217 | * with devices that use it and those that don't. | 217 | * with devices that use it and those that don't. |
218 | */ | 218 | */ |
219 | if ((detail->bDetailData[1] & ~0x02) != 0x01) { | 219 | if ((detail->bDetailData[1] & ~0x02) != 0x01) { |
220 | /* bmDataCapabilites == 0 would be fine too, | 220 | /* bmDataCapabilities == 0 would be fine too, |
221 | * but framing is minidriver-coupled for now. | 221 | * but framing is minidriver-coupled for now. |
222 | */ | 222 | */ |
223 | bad_detail: | 223 | bad_detail: |