aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2012-08-17 04:44:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-20 17:38:08 -0400
commit7fda953ffed1b94aa68f80c6c3ab312328aedcb3 (patch)
tree13be546c8b34fac9b678cb02a024c9737d5af693
parent2d366846598d5f562866bba61a836d9325878066 (diff)
usb: convert USB_QUIRK_RESET_MORPHS to USB_QUIRK_RESET
Since the attribute avoid_reset_quirk is work for all devices including those devices that can't morph, convert USB_QUIRK_RESET_MORPHS to USB_QUIRK_RESET. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/quirks.c2
-rw-r--r--drivers/usb/core/sysfs.c6
-rw-r--r--drivers/usb/storage/transport.c2
-rw-r--r--include/linux/usb/quirks.h4
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index f15501f4c585..2dbb5154f356 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -205,7 +205,7 @@ void usb_detect_quirks(struct usb_device *udev)
205 * for all devices. It will affect things like hub resets 205 * for all devices. It will affect things like hub resets
206 * and EMF-related port disables. 206 * and EMF-related port disables.
207 */ 207 */
208 if (!(udev->quirks & USB_QUIRK_RESET_MORPHS)) 208 if (!(udev->quirks & USB_QUIRK_RESET))
209 udev->persist_enabled = 1; 209 udev->persist_enabled = 1;
210#endif /* CONFIG_PM */ 210#endif /* CONFIG_PM */
211} 211}
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index d6c49d9ed4e0..818e4a024d0d 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -196,7 +196,7 @@ show_avoid_reset_quirk(struct device *dev, struct device_attribute *attr, char *
196 struct usb_device *udev; 196 struct usb_device *udev;
197 197
198 udev = to_usb_device(dev); 198 udev = to_usb_device(dev);
199 return sprintf(buf, "%d\n", !!(udev->quirks & USB_QUIRK_RESET_MORPHS)); 199 return sprintf(buf, "%d\n", !!(udev->quirks & USB_QUIRK_RESET));
200} 200}
201 201
202static ssize_t 202static ssize_t
@@ -210,9 +210,9 @@ set_avoid_reset_quirk(struct device *dev, struct device_attribute *attr,
210 return -EINVAL; 210 return -EINVAL;
211 usb_lock_device(udev); 211 usb_lock_device(udev);
212 if (val) 212 if (val)
213 udev->quirks |= USB_QUIRK_RESET_MORPHS; 213 udev->quirks |= USB_QUIRK_RESET;
214 else 214 else
215 udev->quirks &= ~USB_QUIRK_RESET_MORPHS; 215 udev->quirks &= ~USB_QUIRK_RESET;
216 usb_unlock_device(udev); 216 usb_unlock_device(udev);
217 return count; 217 return count;
218} 218}
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index c70109e5d60b..c0543c83923e 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -1331,7 +1331,7 @@ int usb_stor_port_reset(struct us_data *us)
1331 int result; 1331 int result;
1332 1332
1333 /*for these devices we must use the class specific method */ 1333 /*for these devices we must use the class specific method */
1334 if (us->pusb_dev->quirks & USB_QUIRK_RESET_MORPHS) 1334 if (us->pusb_dev->quirks & USB_QUIRK_RESET)
1335 return -EPERM; 1335 return -EPERM;
1336 1336
1337 result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf); 1337 result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 3e93de7ecbc3..52f944dfe2fd 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -19,8 +19,8 @@
19/* device can't handle its Configuration or Interface strings */ 19/* device can't handle its Configuration or Interface strings */
20#define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 20#define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008
21 21
22/*device will morph if reset, don't use reset for handling errors */ 22/* device can't be reset(e.g morph devices), don't use reset */
23#define USB_QUIRK_RESET_MORPHS 0x00000010 23#define USB_QUIRK_RESET 0x00000010
24 24
25/* device has more interface descriptions than the bNumInterfaces count, 25/* device has more interface descriptions than the bNumInterfaces count,
26 and can't handle talking to these interfaces */ 26 and can't handle talking to these interfaces */