diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-14 13:59:04 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-14 13:59:04 +0200 |
| commit | 5a7f345ba5e849229317f73497a17637c9a08e4a (patch) | |
| tree | 4d7661b70e4da95d2acfddce1ba76b7b3190cd3f /d01.patch | |
| parent | 1670862cd60c9110a93d8fdd186d4bfe51b185d1 (diff) | |
| download | patches-5a7f345ba5e849229317f73497a17637c9a08e4a.tar.gz | |
get a bunch of stuff finally upstream.
Diffstat (limited to 'd01.patch')
| -rw-r--r-- | d01.patch | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/d01.patch b/d01.patch deleted file mode 100644 index 28c854b364b73f..00000000000000 --- a/d01.patch +++ /dev/null @@ -1,85 +0,0 @@ -From foo@baz Thu Jun 8 15:02:37 CEST 2017 -Date: Thu, 08 Jun 2017 15:02:37 +0200 -To: Greg KH <gregkh@linuxfoundation.org> -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Subject: HID: hid-core: convert to use DRIVER_ATTR_RO and drv_groups - -In the quest to get rid of DRIVER_ATTR(), this patch converts the -hid-core code to use DRIVER_ATTR_RO() and also moves to use drv_groups -as creating individual sysfs files is not good (it races with userspace -notifications.) - -Cc: Jiri Kosina <jikos@kernel.org> -Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> -Cc: <linux-input@vger.kernel.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/hid/hid-core.c | 24 ++++++++++-------------- - 1 file changed, 10 insertions(+), 14 deletions(-) - ---- a/drivers/hid/hid-core.c -+++ b/drivers/hid/hid-core.c -@@ -2147,7 +2147,7 @@ struct hid_dynid { - * Adds a new dynamic hid device ID to this driver, - * and causes the driver to probe for all devices again. - */ --static ssize_t store_new_id(struct device_driver *drv, const char *buf, -+static ssize_t new_id_store(struct device_driver *drv, const char *buf, - size_t count) - { - struct hid_driver *hdrv = to_hid_driver(drv); -@@ -2179,7 +2179,13 @@ static ssize_t store_new_id(struct devic - - return ret ? : count; - } --static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id); -+static DRIVER_ATTR_WO(new_id); -+ -+static struct attribute *hid_drv_attrs[] = { -+ &driver_attr_new_id.attr, -+ NULL, -+}; -+ATTRIBUTE_GROUPS(hid_drv); - - static void hid_free_dynids(struct hid_driver *hdrv) - { -@@ -2343,6 +2349,7 @@ static int hid_uevent(struct device *dev - static struct bus_type hid_bus_type = { - .name = "hid", - .dev_groups = hid_dev_groups, -+ .drv_groups = hid_drv_groups, - .match = hid_bus_match, - .probe = hid_device_probe, - .remove = hid_device_remove, -@@ -2782,8 +2789,6 @@ EXPORT_SYMBOL_GPL(hid_destroy_device); - int __hid_register_driver(struct hid_driver *hdrv, struct module *owner, - const char *mod_name) - { -- int ret; -- - hdrv->driver.name = hdrv->name; - hdrv->driver.bus = &hid_bus_type; - hdrv->driver.owner = owner; -@@ -2792,21 +2797,12 @@ int __hid_register_driver(struct hid_dri - INIT_LIST_HEAD(&hdrv->dyn_list); - spin_lock_init(&hdrv->dyn_lock); - -- ret = driver_register(&hdrv->driver); -- if (ret) -- return ret; -- -- ret = driver_create_file(&hdrv->driver, &driver_attr_new_id); -- if (ret) -- driver_unregister(&hdrv->driver); -- -- return ret; -+ return driver_register(&hdrv->driver); - } - EXPORT_SYMBOL_GPL(__hid_register_driver); - - void hid_unregister_driver(struct hid_driver *hdrv) - { -- driver_remove_file(&hdrv->driver, &driver_attr_new_id); - driver_unregister(&hdrv->driver); - hid_free_dynids(hdrv); - } |
