All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danny Kaehn <kaehndan@gmail.com>
To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	jikos@kernel.org, benjamin.tissoires@redhat.com
Cc: devicetree@vger.kernel.org, linux-input@vger.kernel.org,
	ethan.twardy@plexus.com
Subject: [PATCH v3 2/4] HID: usbhid: Share USB device devicetree node with child HID device
Date: Sun,  5 Feb 2023 08:54:48 -0600	[thread overview]
Message-ID: <20230205145450.3396-3-kaehndan@gmail.com> (raw)
In-Reply-To: <20230205145450.3396-1-kaehndan@gmail.com>

USB HID core now shares its devicetree of_node with its child HID device.
Since there can only be one HID device on a USB interface, it is redundant
to specify a hid node under the USB device (and further, binding this way
isn't currently possible, as hid_driver does not support of_match_table).

Signed-off-by: Danny Kaehn <kaehndan@gmail.com>
---
 drivers/hid/usbhid/hid-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index be4c731aaa65..b6c968af258f 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -33,6 +33,7 @@
 #include <linux/hiddev.h>
 #include <linux/hid-debug.h>
 #include <linux/hidraw.h>
+#include <linux/device.h>
 #include "usbhid.h"
 
 /*
@@ -1369,6 +1370,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
 	hid->hiddev_report_event = hiddev_report_event;
 #endif
 	hid->dev.parent = &intf->dev;
+	device_set_of_node_from_dev(&hid->dev, &intf->dev);
 	hid->bus = BUS_USB;
 	hid->vendor = le16_to_cpu(dev->descriptor.idVendor);
 	hid->product = le16_to_cpu(dev->descriptor.idProduct);
-- 
2.25.1


  parent reply	other threads:[~2023-02-05 14:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-05 14:54 [PATCH v3 0/4] DeviceTree Support for USB-HID Devices and CP2112 Danny Kaehn
2023-02-05 14:54 ` [PATCH v3 1/4] dt-bindings: input: Add CP2112 HID USB to SMBus Bridge Danny Kaehn
2023-02-06  7:59   ` Krzysztof Kozlowski
2023-02-06 13:15     ` Daniel Kaehn
2023-02-06 13:37       ` Krzysztof Kozlowski
2023-02-06 16:51   ` Rob Herring
2023-02-05 14:54 ` Danny Kaehn [this message]
2023-02-05 14:54 ` [PATCH v3 3/4] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded Danny Kaehn
2023-02-05 14:54 ` [PATCH v3 4/4] HID: cp2112: Devicetree Support Danny Kaehn
2023-02-06 16:39   ` Rob Herring
2023-02-09 21:01     ` Bartosz Golaszewski

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=20230205145450.3396-3-kaehndan@gmail.com \
    --to=kaehndan@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ethan.twardy@plexus.com \
    --cc=jikos@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=robh+dt@kernel.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 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.