From: "Michal Malý" <madcatxster@devoid-pointer.net>
To: jkosina@suse.cz
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
simon@mungewell.org,
"Michal Malý" <madcatxster@devoid-pointer.net>
Subject: [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled.
Date: Wed, 18 Feb 2015 22:49:33 +0100 [thread overview]
Message-ID: <1424296173-22718-1-git-send-email-madcatxster@devoid-pointer.net> (raw)
Fix "undefined reference" build issue with CONFIG_USB disabled.
Signed-off-by: Michal Malý <madcatxster@devoid-pointer.net>
---
drivers/hid/hid-lg4ff.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index 854982b..1232210 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -569,19 +569,20 @@ static const struct lg4ff_compat_mode_switch *lg4ff_get_mode_switch_command(cons
static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s)
{
- struct usb_device *usbdev = hid_to_usb_dev(hid);
- struct usbhid_device *usbhid = hid->driver_data;
+ struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
+ struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
+ __s32 *value = report->field[0]->value;
u8 i;
for (i = 0; i < s->cmd_count; i++) {
- int xferd, ret;
- u8 data[7];
+ u8 j;
- memcpy(data, s->cmd + (7*i), 7);
- ret = usb_interrupt_msg(usbdev, usbhid->urbout->pipe, data, 7, &xferd, USB_CTRL_SET_TIMEOUT);
- if (ret)
- return ret;
+ for (j = 0; j < 7; j++)
+ value[j] = s->cmd[j + (7*i)];
+
+ hid_hw_request(hid, report, HID_REQ_SET_REPORT);
}
+ hid_hw_wait(hid);
return 0;
}
--
2.3.0
next reply other threads:[~2015-02-18 21:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 21:49 Michal Malý [this message]
2015-02-18 22:47 ` [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled simon
2015-02-18 22:52 ` Jiri Kosina
2015-02-18 22:50 ` 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=1424296173-22718-1-git-send-email-madcatxster@devoid-pointer.net \
--to=madcatxster@devoid-pointer.net \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simon@mungewell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).