All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>,
	Jiri Kosina <jkosina@suse.cz>,
	Nestor Lopez Casado <nlopezcasad@logitech.com>,
	Andrew de los Reyes <adlr@chromium.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] HID: core: do not scan reports if the group is already set
Date: Wed,  8 Jan 2014 17:18:46 -0500	[thread overview]
Message-ID: <1389219529-29671-3-git-send-email-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <1389219529-29671-1-git-send-email-benjamin.tissoires@redhat.com>

From: Benjamin Tisssoires <benjamin.tissoires@redhat.com>

This allows the transport layer (I have in mind hid-logitech-dj and uhid)
to set the group before it is added to the hid bus. This way, it can
bypass the hid_scan_report() call, and choose in advance which driver
will handle the newly created hid device.

Signed-off-by: Benjamin Tisssoires <benjamin.tissoires@redhat.com>
---
 drivers/hid/hid-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index a5a8c6a..200118a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2438,7 +2438,8 @@ int hid_add_device(struct hid_device *hdev)
 	 * Scan generic devices for group information
 	 */
 	if (hid_ignore_special_drivers ||
-	    !hid_match_id(hdev, hid_have_special_driver)) {
+	    (!hdev->group &&
+	     !hid_match_id(hdev, hid_have_special_driver))) {
 		ret = hid_scan_report(hdev);
 		if (ret)
 			hid_warn(hdev, "bad device descriptor (%d)\n", ret);
-- 
1.8.4.2


  parent reply	other threads:[~2014-01-08 22:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08 22:18 [PATCH 0/5] HID logitech DJ fixes and preps for enabling extended features Benjamin Tissoires
2014-01-08 22:18 ` [PATCH 1/5] HID: logitech-dj: Fix USB 3.0 issue Benjamin Tissoires
2014-01-16 21:50   ` Jiri Kosina
2014-01-17  8:48     ` Nestor Lopez Casado
     [not found]       ` <CAE7qMrpEnF3y-dVP14190y33YNidCdjtJeO9PcMVcBBJDJsYuw@mail.gmail.com>
2014-02-14 13:35         ` Nestor Lopez Casado
2014-01-08 22:18 ` Benjamin Tissoires [this message]
2014-01-08 22:18 ` [PATCH 3/5] HID: logitech-dj: rely on hid groups to separate receivers from dj devices Benjamin Tissoires
2014-01-08 22:18 ` [PATCH 4/5] HID: logitech-dj: forward incoming HID++ reports to the correct dj device Benjamin Tissoires
2014-01-08 22:18 ` [PATCH 5/5] HID: logitech-dj: add .request callback Benjamin Tissoires
2014-01-09 21:08 ` [PATCH 0/5] HID logitech DJ fixes and preps for enabling extended features Andrew de los Reyes
2014-01-09 21:22   ` Benjamin Tissoires
2014-01-29 18:21     ` Andrew de los Reyes
2014-01-29 18:42       ` Benjamin Tissoires

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=1389219529-29671-3-git-send-email-benjamin.tissoires@redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=adlr@chromium.org \
    --cc=benjamin.tissoires@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nlopezcasad@logitech.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.