Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1445521 > unrolled thread
| Started by | Martin Kepplinger <martink@posteo.de> |
|---|---|
| First post | 2016-07-18 16:30 +0200 |
| Last post | 2016-07-21 13:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/4] input: tablet: pegasus_notetaker: Fix usb_autopm calls to be balanced Martin Kepplinger <martink@posteo.de> - 2016-07-18 16:30 +0200
Re: [PATCH 2/4] input: tablet: pegasus_notetaker: Fix usb_autopm calls to be balanced Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-07-20 23:40 +0200
Re: [PATCH 2/4] input: tablet: pegasus_notetaker: Fix usb_autopm calls to be balanced Martin Kepplinger <martink@posteo.de> - 2016-07-21 13:10 +0200
| From | Martin Kepplinger <martink@posteo.de> |
|---|---|
| Date | 2016-07-18 16:30 +0200 |
| Subject | [PATCH 2/4] input: tablet: pegasus_notetaker: Fix usb_autopm calls to be balanced |
| Message-ID | <rWhIu-7l8-21@gated-at.bofh.it> |
Signed-off-by: Martin Kepplinger <martink@posteo.de>
---
drivers/input/tablet/pegasus_notetaker.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
index 27cb352..fdbc5e8 100644
--- a/drivers/input/tablet/pegasus_notetaker.c
+++ b/drivers/input/tablet/pegasus_notetaker.c
@@ -208,27 +208,30 @@ static int pegasus_open(struct input_dev *dev)
return retval;
pegasus->irq->dev = pegasus->usbdev;
- if (usb_submit_urb(pegasus->irq, GFP_KERNEL))
+ if (usb_submit_urb(pegasus->irq, GFP_KERNEL)) {
retval = -EIO;
+ goto out;
+ }
retval = pegasus_set_mode(pegasus, PEN_MODE_XY, NOTETAKER_LED_MOUSE);
- usb_autopm_put_interface(pegasus->intf);
+out:
- return retval;
+ if (retval < 0) {
+ usb_autopm_put_interface(pegasus->intf);
+ return retval;
+ } else {
+ return 0;
+ }
}
static void pegasus_close(struct input_dev *dev)
{
struct pegasus *pegasus = input_get_drvdata(dev);
- int autopm_error;
- autopm_error = usb_autopm_get_interface(pegasus->intf);
usb_kill_urb(pegasus->irq);
cancel_work_sync(&pegasus->init);
-
- if (!autopm_error)
- usb_autopm_put_interface(pegasus->intf);
+ usb_autopm_put_interface(pegasus->intf);
}
static int pegasus_probe(struct usb_interface *intf,
--
2.1.4
[toc] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2016-07-20 23:40 +0200 |
| Subject | Re: [PATCH 2/4] input: tablet: pegasus_notetaker: Fix usb_autopm calls to be balanced |
| Message-ID | <rX7nH-6Oz-17@gated-at.bofh.it> |
| In reply to | #1445521 |
On Mon, Jul 18, 2016 at 04:29:07PM +0200, Martin Kepplinger wrote:
> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> ---
> drivers/input/tablet/pegasus_notetaker.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
> index 27cb352..fdbc5e8 100644
> --- a/drivers/input/tablet/pegasus_notetaker.c
> +++ b/drivers/input/tablet/pegasus_notetaker.c
> @@ -208,27 +208,30 @@ static int pegasus_open(struct input_dev *dev)
> return retval;
>
> pegasus->irq->dev = pegasus->usbdev;
> - if (usb_submit_urb(pegasus->irq, GFP_KERNEL))
> + if (usb_submit_urb(pegasus->irq, GFP_KERNEL)) {
> retval = -EIO;
> + goto out;
> + }
>
> retval = pegasus_set_mode(pegasus, PEN_MODE_XY, NOTETAKER_LED_MOUSE);
If this fails I we should kill URB and cancel work. I adjusted and
applied.
>
> - usb_autopm_put_interface(pegasus->intf);
> +out:
>
> - return retval;
> + if (retval < 0) {
> + usb_autopm_put_interface(pegasus->intf);
> + return retval;
> + } else {
> + return 0;
> + }
> }
>
> static void pegasus_close(struct input_dev *dev)
> {
> struct pegasus *pegasus = input_get_drvdata(dev);
> - int autopm_error;
>
> - autopm_error = usb_autopm_get_interface(pegasus->intf);
> usb_kill_urb(pegasus->irq);
> cancel_work_sync(&pegasus->init);
> -
> - if (!autopm_error)
> - usb_autopm_put_interface(pegasus->intf);
> + usb_autopm_put_interface(pegasus->intf);
> }
>
> static int pegasus_probe(struct usb_interface *intf,
> --
> 2.1.4
>
--
Dmitry
[toc] | [prev] | [next] | [standalone]
| From | Martin Kepplinger <martink@posteo.de> |
|---|---|
| Date | 2016-07-21 13:10 +0200 |
| Subject | Re: [PATCH 2/4] input: tablet: pegasus_notetaker: Fix usb_autopm calls to be balanced |
| Message-ID | <rXk1A-6EN-41@gated-at.bofh.it> |
| In reply to | #1447493 |
Am 2016-07-20 um 23:29 schrieb Dmitry Torokhov:
> On Mon, Jul 18, 2016 at 04:29:07PM +0200, Martin Kepplinger wrote:
>> Signed-off-by: Martin Kepplinger <martink@posteo.de>
>> ---
>> drivers/input/tablet/pegasus_notetaker.c | 19 +++++++++++--------
>> 1 file changed, 11 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
>> index 27cb352..fdbc5e8 100644
>> --- a/drivers/input/tablet/pegasus_notetaker.c
>> +++ b/drivers/input/tablet/pegasus_notetaker.c
>> @@ -208,27 +208,30 @@ static int pegasus_open(struct input_dev *dev)
>> return retval;
>>
>> pegasus->irq->dev = pegasus->usbdev;
>> - if (usb_submit_urb(pegasus->irq, GFP_KERNEL))
>> + if (usb_submit_urb(pegasus->irq, GFP_KERNEL)) {
>> retval = -EIO;
>> + goto out;
>> + }
>>
>> retval = pegasus_set_mode(pegasus, PEN_MODE_XY, NOTETAKER_LED_MOUSE);
>
> If this fails I we should kill URB and cancel work. I adjusted and
> applied.
You're right. Thanks for this!
>
>>
>> - usb_autopm_put_interface(pegasus->intf);
>> +out:
>>
>> - return retval;
>> + if (retval < 0) {
>> + usb_autopm_put_interface(pegasus->intf);
>> + return retval;
>> + } else {
>> + return 0;
>> + }
>> }
>>
>> static void pegasus_close(struct input_dev *dev)
>> {
>> struct pegasus *pegasus = input_get_drvdata(dev);
>> - int autopm_error;
>>
>> - autopm_error = usb_autopm_get_interface(pegasus->intf);
>> usb_kill_urb(pegasus->irq);
>> cancel_work_sync(&pegasus->init);
>> -
>> - if (!autopm_error)
>> - usb_autopm_put_interface(pegasus->intf);
>> + usb_autopm_put_interface(pegasus->intf);
>> }
>>
>> static int pegasus_probe(struct usb_interface *intf,
>> --
>> 2.1.4
>>
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web