linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled.
@ 2015-02-18 21:49 Michal Malý
  2015-02-18 22:47 ` simon
  2015-02-18 22:50 ` Jiri Kosina
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Malý @ 2015-02-18 21:49 UTC (permalink / raw)
  To: jkosina; +Cc: linux-input, linux-kernel, simon, Michal Malý

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled.
  2015-02-18 21:49 [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled Michal Malý
@ 2015-02-18 22:47 ` simon
  2015-02-18 22:52   ` Jiri Kosina
  2015-02-18 22:50 ` Jiri Kosina
  1 sibling, 1 reply; 4+ messages in thread
From: simon @ 2015-02-18 22:47 UTC (permalink / raw)
  Cc: jkosina, linux-input, linux-kernel, simon,
	"Michal Malý"

> Fix "undefined reference" build issue with CONFIG_USB disabled.

Just a newbie question... for a family of devices (the wheels) which can
only be attached via USB, wouldn't the better approach be to fix the
dependancy?

Are there any other devices provided for by 'hid-logitech' which use any
other transport (HID over Bluetooth or the like)?

Simon.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled.
  2015-02-18 21:49 [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled Michal Malý
  2015-02-18 22:47 ` simon
@ 2015-02-18 22:50 ` Jiri Kosina
  1 sibling, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2015-02-18 22:50 UTC (permalink / raw)
  To: Michal Malý; +Cc: linux-input, linux-kernel, simon

On Wed, 18 Feb 2015, Michal Malý wrote:

> Fix "undefined reference" build issue with CONFIG_USB disabled.
> 
> Signed-off-by: Michal Malý <madcatxster@devoid-pointer.net>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled.
  2015-02-18 22:47 ` simon
@ 2015-02-18 22:52   ` Jiri Kosina
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2015-02-18 22:52 UTC (permalink / raw)
  To: simon; +Cc: "Michal Malý", linux-input, linux-kernel

On Wed, 18 Feb 2015, simon@mungewell.org wrote:

> > Fix "undefined reference" build issue with CONFIG_USB disabled.
> 
> Just a newbie question... for a family of devices (the wheels) which can
> only be attached via USB, wouldn't the better approach be to fix the
> dependancy?
> 
> Are there any other devices provided for by 'hid-logitech' which use any
> other transport (HID over Bluetooth or the like)?

Using only HID API (and let it call to the transport driver) is much 
cleaner way and helps a lot with avoiding code duplication, etc.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-18 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18 21:49 [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled Michal Malý
2015-02-18 22:47 ` simon
2015-02-18 22:52   ` Jiri Kosina
2015-02-18 22:50 ` Jiri Kosina

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).