Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753947AbbFZTcy (ORCPT ); Fri, 26 Jun 2015 15:32:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40541 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752682AbbFZTcP (ORCPT ); Fri, 26 Jun 2015 15:32:15 -0400 Date: Fri, 26 Jun 2015 12:32:14 -0700 From: Greg Kroah-Hartman To: Tom Gundersen Cc: linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Kosina Subject: Re: [PATCH][RFC] usbhid: enable autosuspend for internal devices Message-ID: <20150626193214.GA26161@kroah.com> References: <1435346647-29473-1-git-send-email-teg@jklm.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435346647-29473-1-git-send-email-teg@jklm.no> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 49 On Fri, Jun 26, 2015 at 09:24:07PM +0200, Tom Gundersen wrote: > This policy used to be unconditionally applied by udev, but there > is no reason to make userspace be involved in this and in the future > udev will not be doing it by default. > > See: . > > Signed-off-by: Tom Gundersen > Cc: Jiri Kosina > Cc: Greg Kroah-Hartman > --- > > Hi, > > I don't have the right hardware for this, so it has only been compile-tested. > I'm therefore sending it as an RFC only. Mainly I want to bring it to people's > attention that it would be great to get this feature into the kernel as we want > to drop it from udev. > > Cheers, > > Tom > > drivers/hid/usbhid/hid-core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c > index bfbe1be..af80700 100644 > --- a/drivers/hid/usbhid/hid-core.c > +++ b/drivers/hid/usbhid/hid-core.c > @@ -1358,6 +1358,9 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * > setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid); > spin_lock_init(&usbhid->lock); > > + if (dev->removable == USB_DEVICE_FIXED) > + usb_enable_autosuspend(dev); > + As this duplicates what udev has been doing for a while now, we should be safe here. thanks for the patch. Acked-by: Greg Kroah-Hartman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/