From: Richard Nauber <RichardNauber@web.de>
To: jkosina@suse.cz
Cc: linux-input@vger.kernel.org
Subject: [PATCH] [HID] hid-sony: regression probing a SIXAXIS controller - wrong return value
Date: Tue, 30 Dec 2008 23:15:30 +0100 [thread overview]
Message-ID: <495A9D82.7090500@web.de> (raw)
This patch fixes a regression introduced in bd28ce00. It occurs when
attaching a Sony SIXAXIS controller:
input: Sony PLAYSTATION(R)3 Controller as
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/input/input9
sony 0003:054C:0268.0006: input,hiddev96,hidraw0: USB HID v1.11 Joystick
[Sony PLAYSTATION(R)3 Controller] on usb-0000:00:1d.0-1/input0
sony: probe of 0003:054C:0268.0006 failed with error 17
The reason for this nasty behavior is a wrong return value emitted by
sony_set_operational().
Carry on playing with your Christmas gifts,
Richard
Signed-off-by: Richard Nauber <Richard.Nauber@web.de>
---
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 86e563b..e807d2f 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -65,12 +65,15 @@ static int sony_set_operational(struct hid_device *hdev)
USB_RECIP_INTERFACE,
(3 << 8) | 0xf2, ifnum, buf, 17,
USB_CTRL_GET_TIMEOUT);
- if (ret < 0)
- dev_err(&hdev->dev, "can't set operational mode\n");
kfree(buf);
- return ret;
+ if (ret <= 0) {
+ dev_err(&hdev->dev, "can't set operational mode\n");
+ return (ret ? ret : -EIO );
+ }
+
+ return 0;
}
static int sony_probe(struct hid_device *hdev, const struct
hid_device_id *id)
--
next reply other threads:[~2008-12-30 22:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 22:15 Richard Nauber [this message]
2009-01-03 1:21 ` [PATCH] [HID] hid-sony: regression probing a SIXAXIS controller - wrong return value Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=495A9D82.7090500@web.de \
--to=richardnauber@web.de \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.