From patchwork Wed Feb 18 21:49:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michal_Mal=C3=BD?= X-Patchwork-Id: 5848061 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 904A6BF440 for ; Wed, 18 Feb 2015 21:50:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93A57202DD for ; Wed, 18 Feb 2015 21:50:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDB7E202D1 for ; Wed, 18 Feb 2015 21:50:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbbBRVty (ORCPT ); Wed, 18 Feb 2015 16:49:54 -0500 Received: from imap.devoid-pointer.net ([31.31.77.140]:40927 "EHLO smtp.devoid-pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbbBRVty (ORCPT ); Wed, 18 Feb 2015 16:49:54 -0500 Received: from Labrat.localdomain.localdomain (228.123.broadband5.iol.cz [88.100.123.228]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by smtp.devoid-pointer.net (Postfix) with ESMTPSA id B256C21855; Wed, 18 Feb 2015 22:49:41 +0100 (CET) From: =?UTF-8?q?Michal=20Mal=C3=BD?= To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, simon@mungewell.org, =?UTF-8?q?Michal=20Mal=C3=BD?= Subject: [PATCH] HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled. Date: Wed, 18 Feb 2015 22:49:33 +0100 Message-Id: <1424296173-22718-1-git-send-email-madcatxster@devoid-pointer.net> X-Mailer: git-send-email 2.3.0 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix "undefined reference" build issue with CONFIG_USB disabled. Signed-off-by: Michal MalĂ˝ --- 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; }