aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-01 13:00:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-01 13:00:28 -0500
commit47fcc0360cfb3fe82e4daddacad3c1cd80b0b75d (patch)
tree6a72f705c4e16643e08152ce7828a23c68c623ae /lib
parent5d8515bc232172963a4cef007e97b08c5e4d0533 (diff)
parentc505cbd45f6e9c539d57dd171d95ec7e5e9f9cd0 (diff)
Merge tag 'driver-core-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH: "Here is the set of "big" driver core patches for 4.16-rc1. The majority of the work here is in the firmware subsystem, with reworks to try to attempt to make the code easier to handle in the long run, but no functional change. There's also some tree-wide sysfs attribute fixups with lots of acks from the various subsystem maintainers, as well as a handful of other normal fixes and changes. And finally, some license cleanups for the driver core and sysfs code. All have been in linux-next for a while with no reported issues" * tag 'driver-core-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (48 commits) device property: Define type of PROPERTY_ENRTY_*() macros device property: Reuse property_entry_free_data() device property: Move property_entry_free_data() upper firmware: Fix up docs referring to FIRMWARE_IN_KERNEL firmware: Drop FIRMWARE_IN_KERNEL Kconfig option USB: serial: keyspan: Drop firmware Kconfig options sysfs: remove DEBUG defines sysfs: use SPDX identifiers drivers: base: add coredump driver ops sysfs: add attribute specification for /sysfs/devices/.../coredump test_firmware: fix missing unlock on error in config_num_requests_store() test_firmware: make local symbol test_fw_config static sysfs: turn WARN() into pr_warn() firmware: Fix a typo in fallback-mechanisms.rst treewide: Use DEVICE_ATTR_WO treewide: Use DEVICE_ATTR_RO treewide: Use DEVICE_ATTR_RW sysfs.h: Use octal permissions component: add debugfs support bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate ...
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject.c4
-rw-r--r--lib/kobject_uevent.c3
-rw-r--r--lib/test_firmware.c17
-rw-r--r--lib/test_kmod.c14
4 files changed, 14 insertions, 24 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 06b849eee0ca..afd5a3fc6123 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * kobject.c - library routines for handling generic kernel objects 3 * kobject.c - library routines for handling generic kernel objects
3 * 4 *
@@ -5,9 +6,6 @@
5 * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com> 6 * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (c) 2006-2007 Novell Inc. 7 * Copyright (c) 2006-2007 Novell Inc.
7 * 8 *
8 * This file is released under the GPLv2.
9 *
10 *
11 * Please see the file Documentation/kobject.txt for critical information 9 * Please see the file Documentation/kobject.txt for critical information
12 * about using the kobject interface. 10 * about using the kobject interface.
13 */ 11 */
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 2615074d3de5..9fe6ec8fda28 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * kernel userspace event delivery 3 * kernel userspace event delivery
3 * 4 *
@@ -5,8 +6,6 @@
5 * Copyright (C) 2004 Novell, Inc. All rights reserved. 6 * Copyright (C) 2004 Novell, Inc. All rights reserved.
6 * Copyright (C) 2004 IBM, Inc. All rights reserved. 7 * Copyright (C) 2004 IBM, Inc. All rights reserved.
7 * 8 *
8 * Licensed under the GNU GPL v2.
9 *
10 * Authors: 9 * Authors:
11 * Robert Love <rml@novell.com> 10 * Robert Love <rml@novell.com>
12 * Kay Sievers <kay.sievers@vrfy.org> 11 * Kay Sievers <kay.sievers@vrfy.org>
diff --git a/lib/test_firmware.c b/lib/test_firmware.c
index 64a4c76cba2b..078a61480573 100644
--- a/lib/test_firmware.c
+++ b/lib/test_firmware.c
@@ -96,7 +96,7 @@ struct test_config {
96 struct device *device); 96 struct device *device);
97}; 97};
98 98
99struct test_config *test_fw_config; 99static struct test_config *test_fw_config;
100 100
101static ssize_t test_fw_misc_read(struct file *f, char __user *buf, 101static ssize_t test_fw_misc_read(struct file *f, char __user *buf,
102 size_t size, loff_t *offset) 102 size_t size, loff_t *offset)
@@ -359,7 +359,7 @@ static ssize_t config_name_show(struct device *dev,
359{ 359{
360 return config_test_show_str(buf, test_fw_config->name); 360 return config_test_show_str(buf, test_fw_config->name);
361} 361}
362static DEVICE_ATTR(config_name, 0644, config_name_show, config_name_store); 362static DEVICE_ATTR_RW(config_name);
363 363
364static ssize_t config_num_requests_store(struct device *dev, 364static ssize_t config_num_requests_store(struct device *dev,
365 struct device_attribute *attr, 365 struct device_attribute *attr,
@@ -371,6 +371,7 @@ static ssize_t config_num_requests_store(struct device *dev,
371 if (test_fw_config->reqs) { 371 if (test_fw_config->reqs) {
372 pr_err("Must call release_all_firmware prior to changing config\n"); 372 pr_err("Must call release_all_firmware prior to changing config\n");
373 rc = -EINVAL; 373 rc = -EINVAL;
374 mutex_unlock(&test_fw_mutex);
374 goto out; 375 goto out;
375 } 376 }
376 mutex_unlock(&test_fw_mutex); 377 mutex_unlock(&test_fw_mutex);
@@ -388,8 +389,7 @@ static ssize_t config_num_requests_show(struct device *dev,
388{ 389{
389 return test_dev_config_show_u8(buf, test_fw_config->num_requests); 390 return test_dev_config_show_u8(buf, test_fw_config->num_requests);
390} 391}
391static DEVICE_ATTR(config_num_requests, 0644, config_num_requests_show, 392static DEVICE_ATTR_RW(config_num_requests);
392 config_num_requests_store);
393 393
394static ssize_t config_sync_direct_store(struct device *dev, 394static ssize_t config_sync_direct_store(struct device *dev,
395 struct device_attribute *attr, 395 struct device_attribute *attr,
@@ -411,8 +411,7 @@ static ssize_t config_sync_direct_show(struct device *dev,
411{ 411{
412 return test_dev_config_show_bool(buf, test_fw_config->sync_direct); 412 return test_dev_config_show_bool(buf, test_fw_config->sync_direct);
413} 413}
414static DEVICE_ATTR(config_sync_direct, 0644, config_sync_direct_show, 414static DEVICE_ATTR_RW(config_sync_direct);
415 config_sync_direct_store);
416 415
417static ssize_t config_send_uevent_store(struct device *dev, 416static ssize_t config_send_uevent_store(struct device *dev,
418 struct device_attribute *attr, 417 struct device_attribute *attr,
@@ -428,8 +427,7 @@ static ssize_t config_send_uevent_show(struct device *dev,
428{ 427{
429 return test_dev_config_show_bool(buf, test_fw_config->send_uevent); 428 return test_dev_config_show_bool(buf, test_fw_config->send_uevent);
430} 429}
431static DEVICE_ATTR(config_send_uevent, 0644, config_send_uevent_show, 430static DEVICE_ATTR_RW(config_send_uevent);
432 config_send_uevent_store);
433 431
434static ssize_t config_read_fw_idx_store(struct device *dev, 432static ssize_t config_read_fw_idx_store(struct device *dev,
435 struct device_attribute *attr, 433 struct device_attribute *attr,
@@ -445,8 +443,7 @@ static ssize_t config_read_fw_idx_show(struct device *dev,
445{ 443{
446 return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx); 444 return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx);
447} 445}
448static DEVICE_ATTR(config_read_fw_idx, 0644, config_read_fw_idx_show, 446static DEVICE_ATTR_RW(config_read_fw_idx);
449 config_read_fw_idx_store);
450 447
451 448
452static ssize_t trigger_request_store(struct device *dev, 449static ssize_t trigger_request_store(struct device *dev,
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 337f408b4de6..e372b97eee13 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -694,8 +694,7 @@ static ssize_t config_test_driver_show(struct device *dev,
694 return config_test_show_str(&test_dev->config_mutex, buf, 694 return config_test_show_str(&test_dev->config_mutex, buf,
695 config->test_driver); 695 config->test_driver);
696} 696}
697static DEVICE_ATTR(config_test_driver, 0644, config_test_driver_show, 697static DEVICE_ATTR_RW(config_test_driver);
698 config_test_driver_store);
699 698
700static ssize_t config_test_fs_store(struct device *dev, 699static ssize_t config_test_fs_store(struct device *dev,
701 struct device_attribute *attr, 700 struct device_attribute *attr,
@@ -726,8 +725,7 @@ static ssize_t config_test_fs_show(struct device *dev,
726 return config_test_show_str(&test_dev->config_mutex, buf, 725 return config_test_show_str(&test_dev->config_mutex, buf,
727 config->test_fs); 726 config->test_fs);
728} 727}
729static DEVICE_ATTR(config_test_fs, 0644, config_test_fs_show, 728static DEVICE_ATTR_RW(config_test_fs);
730 config_test_fs_store);
731 729
732static int trigger_config_run_type(struct kmod_test_device *test_dev, 730static int trigger_config_run_type(struct kmod_test_device *test_dev,
733 enum kmod_test_case test_case, 731 enum kmod_test_case test_case,
@@ -1012,8 +1010,7 @@ static ssize_t config_num_threads_show(struct device *dev,
1012 1010
1013 return test_dev_config_show_int(test_dev, buf, config->num_threads); 1011 return test_dev_config_show_int(test_dev, buf, config->num_threads);
1014} 1012}
1015static DEVICE_ATTR(config_num_threads, 0644, config_num_threads_show, 1013static DEVICE_ATTR_RW(config_num_threads);
1016 config_num_threads_store);
1017 1014
1018static ssize_t config_test_case_store(struct device *dev, 1015static ssize_t config_test_case_store(struct device *dev,
1019 struct device_attribute *attr, 1016 struct device_attribute *attr,
@@ -1037,8 +1034,7 @@ static ssize_t config_test_case_show(struct device *dev,
1037 1034
1038 return test_dev_config_show_uint(test_dev, buf, config->test_case); 1035 return test_dev_config_show_uint(test_dev, buf, config->test_case);
1039} 1036}
1040static DEVICE_ATTR(config_test_case, 0644, config_test_case_show, 1037static DEVICE_ATTR_RW(config_test_case);
1041 config_test_case_store);
1042 1038
1043static ssize_t test_result_show(struct device *dev, 1039static ssize_t test_result_show(struct device *dev,
1044 struct device_attribute *attr, 1040 struct device_attribute *attr,
@@ -1049,7 +1045,7 @@ static ssize_t test_result_show(struct device *dev,
1049 1045
1050 return test_dev_config_show_int(test_dev, buf, config->test_result); 1046 return test_dev_config_show_int(test_dev, buf, config->test_result);
1051} 1047}
1052static DEVICE_ATTR(test_result, 0644, test_result_show, test_result_store); 1048static DEVICE_ATTR_RW(test_result);
1053 1049
1054#define TEST_KMOD_DEV_ATTR(name) &dev_attr_##name.attr 1050#define TEST_KMOD_DEV_ATTR(name) &dev_attr_##name.attr
1055 1051