Re: Blackberry driver and pm
Alan Stern <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 8 Feb 2007, Oliver Neukum wrote: > Am Donnerstag, 8. Februar 2007 02:25 schrieb Greg KH: > > > Or is this in relation to the autosuspend issues? > > These exist, too. You've added the blackberry to the quirk list. > This is incorrect. For once, somebody might compile a kernel > without your driver. In this case disabling power management > is wrong. > Strictly speaking this issue should be left to user space, but if > you want to do it in kernel, here's the patch. > > Regards > Oliver > > Signed-off-by: Oliver Neukum <[email protected]> > ---- > > --- a/drivers/usb/misc/berry_charge.c 2007-02-08 11:00:02.000000000 +0100 > +++ b/drivers/usb/misc/berry_charge.c 2007-02-08 11:01:33.000000000 +0100 > @@ -99,6 +99,8 @@ > if ((udev->actconfig->desc.bMaxPower * 2) == 500) { > dbg(&udev->dev, "device is already charging, power is " > "set to %dmA\n", udev->actconfig->desc.bMaxPower * 2); > + /* but we make sure the device be not autosuspended */ > + usb_autopm_get_interface(intf); > return -ENODEV; > } You shouldn't call usb_autopm_get_interface(). The changes it makes are lost when the driver fails to bind to the interface. You should call usb_autopm_resume_device() instead -- unfortunately it isn't EXPORTed. Alan Stern ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel