Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362193
b: refs/heads/master
c: f1a9a14
h: refs/heads/master
i:
  362191: a26a372
v: v3
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Apr 4, 2013
1 parent 34028ed commit 228b18b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30b29537bcba070b3df8d7d24c1975676a1a6a4f
refs/heads/master: f1a9a149abc86903e81dd1b2e720f3f89874384b
29 changes: 20 additions & 9 deletions trunk/drivers/hid/hid-magicmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,21 @@ static int magicmouse_input_mapping(struct hid_device *hdev,
return 0;
}

static void magicmouse_input_configured(struct hid_device *hdev,
struct hid_input *hi)

{
struct magicmouse_sc *msc = hid_get_drvdata(hdev);

int ret = magicmouse_setup_input(msc->input, hdev);
if (ret) {
hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
/* clean msc->input to notify probe() of the failure */
msc->input = NULL;
}
}


static int magicmouse_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{
Expand Down Expand Up @@ -493,15 +508,10 @@ static int magicmouse_probe(struct hid_device *hdev,
goto err_free;
}

/* We do this after hid-input is done parsing reports so that
* hid-input uses the most natural button and axis IDs.
*/
if (msc->input) {
ret = magicmouse_setup_input(msc->input, hdev);
if (ret) {
hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
goto err_stop_hw;
}
if (!msc->input) {
hid_err(hdev, "magicmouse input not registered\n");
ret = -ENOMEM;
goto err_stop_hw;
}

if (id->product == USB_DEVICE_ID_APPLE_MAGICMOUSE)
Expand Down Expand Up @@ -568,6 +578,7 @@ static struct hid_driver magicmouse_driver = {
.remove = magicmouse_remove,
.raw_event = magicmouse_raw_event,
.input_mapping = magicmouse_input_mapping,
.input_configured = magicmouse_input_configured,
};
module_hid_driver(magicmouse_driver);

Expand Down

0 comments on commit 228b18b

Please sign in to comment.