diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-03-03 15:15:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-24 21:16:32 -0700 |
commit | feccc30d90155bcbc937f87643182a43d25873eb (patch) | |
tree | 96394e24075a885f1a8bb3e53203f8397e78ea46 /drivers/usb/core/sysfs.c | |
parent | 5e6effaed6da94e727cd45f945ad2489af8570b3 (diff) | |
download | linux-feccc30d90155bcbc937f87643182a43d25873eb.tar.bz2 |
USB: remove CONFIG_USB_PERSIST setting
This patch (as1047) removes the USB_PERSIST Kconfig option, enabling
it permanently. It also prevents the power/persist attribute from
being created for hub devices; there's no point in having it since
USB-PERSIST is always turned on for hubs.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r-- | drivers/usb/core/sysfs.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index a37ccbd1e007..5b20a60de8ba 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -180,11 +180,9 @@ show_urbnum(struct device *dev, struct device_attribute *attr, char *buf) static DEVICE_ATTR(urbnum, S_IRUGO, show_urbnum, NULL); -#if defined(CONFIG_USB_PERSIST) || defined(CONFIG_USB_SUSPEND) -static const char power_group[] = "power"; -#endif +#ifdef CONFIG_PM -#ifdef CONFIG_USB_PERSIST +static const char power_group[] = "power"; static ssize_t show_persist(struct device *dev, struct device_attribute *attr, char *buf) @@ -222,12 +220,13 @@ static int add_persist_attributes(struct device *dev) if (is_usb_device(dev)) { struct usb_device *udev = to_usb_device(dev); - /* Hubs are automatically enabled for USB_PERSIST */ - if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) - udev->persist_enabled = 1; - rc = sysfs_add_file_to_group(&dev->kobj, - &dev_attr_persist.attr, - power_group); + /* Hubs are automatically enabled for USB_PERSIST, + * no point in creating the attribute file. + */ + if (udev->descriptor.bDeviceClass != USB_CLASS_HUB) + rc = sysfs_add_file_to_group(&dev->kobj, + &dev_attr_persist.attr, + power_group); } return rc; } @@ -238,13 +237,12 @@ static void remove_persist_attributes(struct device *dev) &dev_attr_persist.attr, power_group); } - #else #define add_persist_attributes(dev) 0 #define remove_persist_attributes(dev) do {} while (0) -#endif /* CONFIG_USB_PERSIST */ +#endif /* CONFIG_PM */ #ifdef CONFIG_USB_SUSPEND |