From patchwork Sat Apr 20 11:21:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10910243 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D72E21515 for ; Sat, 20 Apr 2019 11:22:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C775B28D25 for ; Sat, 20 Apr 2019 11:22:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB95128D94; Sat, 20 Apr 2019 11:22:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 510BE28D25 for ; Sat, 20 Apr 2019 11:22:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728054AbfDTLWi (ORCPT ); Sat, 20 Apr 2019 07:22:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56638 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbfDTLWi (ORCPT ); Sat, 20 Apr 2019 07:22:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39769319937A; Sat, 20 Apr 2019 11:22:38 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-20.ams2.redhat.com [10.36.116.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24B3219C5B; Sat, 20 Apr 2019 11:22:36 +0000 (UTC) From: Hans de Goede To: Jiri Kosina , Benjamin Tissoires Cc: Hans de Goede , Nestor Lopez Casado , linux-input@vger.kernel.org Subject: [PATCH v3 11/37] HID: logitech-dj: rename dj_receiver_dev.hdev to dj_receiver_dev.hidpp Date: Sat, 20 Apr 2019 13:21:51 +0200 Message-Id: <20190420112217.27590-12-hdegoede@redhat.com> In-Reply-To: <20190420112217.27590-1-hdegoede@redhat.com> References: <20190420112217.27590-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 20 Apr 2019 11:22:38 +0000 (UTC) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For the upcoming non-unifying receiver support, we are going to bind to all USB-interfaces of a receiver, sharing a single struct dj_receiver_dev between the interfaces. This means that dj_receiver_dev will contain multiple pointers to a struct hid_device. Rename the current hdev member to hidpp to prepare for this. While at it switch dev_err calls which we are touching anyways from dev_err to hid_err. Signed-off-by: Hans de Goede --- drivers/hid/hid-logitech-dj.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index e9a165790482..6244fd41b153 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -119,7 +119,7 @@ struct hidpp_event { } __packed; struct dj_receiver_dev { - struct hid_device *hdev; + struct hid_device *hidpp; struct dj_device *paired_dj_devices[DJ_MAX_PAIRED_DEVICES + DJ_DEVICE_INDEX_MIN]; struct work_struct work; @@ -380,7 +380,7 @@ static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev, hid_destroy_device(dj_dev->hdev); kfree(dj_dev); } else { - dev_err(&djrcv_dev->hdev->dev, "%s: can't destroy a NULL device\n", + hid_err(djrcv_dev->hidpp, "%s: can't destroy a NULL device\n", __func__); } } @@ -389,7 +389,7 @@ static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev, struct dj_workitem *workitem) { /* Called in delayed work context */ - struct hid_device *djrcv_hdev = djrcv_dev->hdev; + struct hid_device *djrcv_hdev = djrcv_dev->hidpp; struct hid_device *dj_hiddev; struct dj_device *dj_dev; u8 device_index = workitem->device_index; @@ -483,8 +483,7 @@ static void delayedwork_callback(struct work_struct *work) count = kfifo_out(&djrcv_dev->notif_fifo, &workitem, sizeof(workitem)); if (count != sizeof(workitem)) { - dev_err(&djrcv_dev->hdev->dev, "%s: workitem triggered without " - "notifications available\n", __func__); + hid_err(djrcv_dev->hidpp, "delayedwork queued without workitems available\n"); spin_unlock_irqrestore(&djrcv_dev->lock, flags); return; } @@ -508,8 +507,7 @@ static void delayedwork_callback(struct work_struct *work) case WORKITEM_TYPE_UNKNOWN: retval = logi_dj_recv_query_paired_devices(djrcv_dev); if (retval) { - dev_err(&djrcv_dev->hdev->dev, - "%s: logi_dj_recv_query_paired_devices error: %d\n", + hid_err(djrcv_dev->hidpp, "%s: logi_dj_recv_query_paired_devices error: %d\n", __func__, retval); } break; @@ -631,7 +629,7 @@ static void logi_dj_recv_forward_report(struct dj_device *dj_dev, u8 *data, static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev, struct dj_report *dj_report) { - struct hid_device *hdev = djrcv_dev->hdev; + struct hid_device *hdev = djrcv_dev->hidpp; struct hid_report *report; struct hid_report_enum *output_report_enum; u8 *data = (u8 *)(&dj_report->device_index); @@ -673,7 +671,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, unsigned timeout) { - struct hid_device *hdev = djrcv_dev->hdev; + struct hid_device *hdev = djrcv_dev->hidpp; struct dj_report *dj_report; u8 *buf; int retval; @@ -770,7 +768,7 @@ static int logi_dj_ll_raw_request(struct hid_device *hid, buf[4] = (buf[4] & 0xf0) | (djdev->device_index - 1); else buf[1] = djdev->device_index; - return hid_hw_raw_request(djrcv_dev->hdev, reportnum, buf, + return hid_hw_raw_request(djrcv_dev->hidpp, reportnum, buf, count, report_type, reqtype); } @@ -788,7 +786,7 @@ static int logi_dj_ll_raw_request(struct hid_device *hid, out_buf[1] = djdev->device_index; memcpy(out_buf + 2, buf, count); - ret = hid_hw_raw_request(djrcv_dev->hdev, out_buf[0], out_buf, + ret = hid_hw_raw_request(djrcv_dev->hidpp, out_buf[0], out_buf, DJREPORT_SHORT_LENGTH, report_type, reqtype); kfree(out_buf); @@ -1086,7 +1084,7 @@ static int logi_dj_probe(struct hid_device *hdev, "%s:failed allocating dj_receiver_dev\n", __func__); return -ENOMEM; } - djrcv_dev->hdev = hdev; + djrcv_dev->hidpp = hdev; INIT_WORK(&djrcv_dev->work, delayedwork_callback); spin_lock_init(&djrcv_dev->lock); if (kfifo_alloc(&djrcv_dev->notif_fifo,