diff options
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r-- | drivers/usb/core/sysfs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index b65c1eaf3aba..06863befaf3a 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -383,12 +383,23 @@ static DEVICE_ATTR(autosuspend, S_IRUGO | S_IWUSR, | |||
383 | static const char on_string[] = "on"; | 383 | static const char on_string[] = "on"; |
384 | static const char auto_string[] = "auto"; | 384 | static const char auto_string[] = "auto"; |
385 | 385 | ||
386 | static void warn_level(void) { | ||
387 | static int level_warned; | ||
388 | |||
389 | if (!level_warned) { | ||
390 | level_warned = 1; | ||
391 | printk(KERN_WARNING "WARNING! power/level is deprecated; " | ||
392 | "use power/control instead\n"); | ||
393 | } | ||
394 | } | ||
395 | |||
386 | static ssize_t | 396 | static ssize_t |
387 | show_level(struct device *dev, struct device_attribute *attr, char *buf) | 397 | show_level(struct device *dev, struct device_attribute *attr, char *buf) |
388 | { | 398 | { |
389 | struct usb_device *udev = to_usb_device(dev); | 399 | struct usb_device *udev = to_usb_device(dev); |
390 | const char *p = auto_string; | 400 | const char *p = auto_string; |
391 | 401 | ||
402 | warn_level(); | ||
392 | if (udev->state != USB_STATE_SUSPENDED && !udev->dev.power.runtime_auto) | 403 | if (udev->state != USB_STATE_SUSPENDED && !udev->dev.power.runtime_auto) |
393 | p = on_string; | 404 | p = on_string; |
394 | return sprintf(buf, "%s\n", p); | 405 | return sprintf(buf, "%s\n", p); |
@@ -403,6 +414,7 @@ set_level(struct device *dev, struct device_attribute *attr, | |||
403 | char *cp; | 414 | char *cp; |
404 | int rc = count; | 415 | int rc = count; |
405 | 416 | ||
417 | warn_level(); | ||
406 | cp = memchr(buf, '\n', count); | 418 | cp = memchr(buf, '\n', count); |
407 | if (cp) | 419 | if (cp) |
408 | len = cp - buf; | 420 | len = cp - buf; |