aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
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 /include/linux
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 'include/linux')
-rw-r--r--include/linux/device.h5
-rw-r--r--include/linux/kobject.h3
-rw-r--r--include/linux/kobject_ns.h3
-rw-r--r--include/linux/property.h10
-rw-r--r--include/linux/sysfs.h14
5 files changed, 15 insertions, 20 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 46ac622e5c6f..f649fc0c2571 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * device.h - generic, centralized driver model 3 * device.h - generic, centralized driver model
3 * 4 *
@@ -5,8 +6,6 @@
5 * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de> 6 * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
6 * Copyright (c) 2008-2009 Novell Inc. 7 * Copyright (c) 2008-2009 Novell Inc.
7 * 8 *
8 * This file is released under the GPLv2
9 *
10 * See Documentation/driver-model/ for more information. 9 * See Documentation/driver-model/ for more information.
11 */ 10 */
12 11
@@ -288,6 +287,7 @@ struct device_driver {
288 const struct attribute_group **groups; 287 const struct attribute_group **groups;
289 288
290 const struct dev_pm_ops *pm; 289 const struct dev_pm_ops *pm;
290 int (*coredump) (struct device *dev);
291 291
292 struct driver_private *p; 292 struct driver_private *p;
293}; 293};
@@ -301,7 +301,6 @@ extern struct device_driver *driver_find(const char *name,
301extern int driver_probe_done(void); 301extern int driver_probe_done(void);
302extern void wait_for_device_probe(void); 302extern void wait_for_device_probe(void);
303 303
304
305/* sysfs interface for exporting driver attributes */ 304/* sysfs interface for exporting driver attributes */
306 305
307struct driver_attribute { 306struct driver_attribute {
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index e0a6205caa71..7f6f93c3df9c 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * kobject.h - generic kernel object infrastructure. 3 * kobject.h - generic kernel object infrastructure.
3 * 4 *
@@ -6,8 +7,6 @@
6 * Copyright (c) 2006-2008 Greg Kroah-Hartman <greg@kroah.com> 7 * Copyright (c) 2006-2008 Greg Kroah-Hartman <greg@kroah.com>
7 * Copyright (c) 2006-2008 Novell Inc. 8 * Copyright (c) 2006-2008 Novell Inc.
8 * 9 *
9 * This file is released under the GPLv2.
10 *
11 * Please read Documentation/kobject.txt before using the kobject 10 * Please read Documentation/kobject.txt before using the kobject
12 * interface, ESPECIALLY the parts about reference counts and object 11 * interface, ESPECIALLY the parts about reference counts and object
13 * destructors. 12 * destructors.
diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h
index df32d2508290..069aa2ebef90 100644
--- a/include/linux/kobject_ns.h
+++ b/include/linux/kobject_ns.h
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1/* Kernel object name space definitions 2/* Kernel object name space definitions
2 * 3 *
3 * Copyright (c) 2002-2003 Patrick Mochel 4 * Copyright (c) 2002-2003 Patrick Mochel
@@ -7,8 +8,6 @@
7 * 8 *
8 * Split from kobject.h by David Howells (dhowells@redhat.com) 9 * Split from kobject.h by David Howells (dhowells@redhat.com)
9 * 10 *
10 * This file is released under the GPLv2.
11 *
12 * Please read Documentation/kobject.txt before using the kobject 11 * Please read Documentation/kobject.txt before using the kobject
13 * interface, ESPECIALLY the parts about reference counts and object 12 * interface, ESPECIALLY the parts about reference counts and object
14 * destructors. 13 * destructors.
diff --git a/include/linux/property.h b/include/linux/property.h
index 1106bc62dd8c..769d372c1edf 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -214,7 +214,7 @@ struct property_entry {
214 */ 214 */
215 215
216#define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ 216#define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \
217{ \ 217(struct property_entry) { \
218 .name = _name_, \ 218 .name = _name_, \
219 .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ 219 .length = ARRAY_SIZE(_val_) * sizeof(_type_), \
220 .is_array = true, \ 220 .is_array = true, \
@@ -232,7 +232,7 @@ struct property_entry {
232 PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) 232 PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_)
233 233
234#define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ 234#define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \
235{ \ 235(struct property_entry) { \
236 .name = _name_, \ 236 .name = _name_, \
237 .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ 237 .length = ARRAY_SIZE(_val_) * sizeof(const char *), \
238 .is_array = true, \ 238 .is_array = true, \
@@ -241,7 +241,7 @@ struct property_entry {
241} 241}
242 242
243#define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ 243#define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \
244{ \ 244(struct property_entry) { \
245 .name = _name_, \ 245 .name = _name_, \
246 .length = sizeof(_type_), \ 246 .length = sizeof(_type_), \
247 .is_string = false, \ 247 .is_string = false, \
@@ -258,7 +258,7 @@ struct property_entry {
258 PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) 258 PROPERTY_ENTRY_INTEGER(_name_, u64, _val_)
259 259
260#define PROPERTY_ENTRY_STRING(_name_, _val_) \ 260#define PROPERTY_ENTRY_STRING(_name_, _val_) \
261{ \ 261(struct property_entry) { \
262 .name = _name_, \ 262 .name = _name_, \
263 .length = sizeof(_val_), \ 263 .length = sizeof(_val_), \
264 .is_string = true, \ 264 .is_string = true, \
@@ -266,7 +266,7 @@ struct property_entry {
266} 266}
267 267
268#define PROPERTY_ENTRY_BOOL(_name_) \ 268#define PROPERTY_ENTRY_BOOL(_name_) \
269{ \ 269(struct property_entry) { \
270 .name = _name_, \ 270 .name = _name_, \
271} 271}
272 272
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 40839c02d28c..b8bfdc173ec0 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -113,7 +113,7 @@ struct attribute_group {
113} 113}
114 114
115#define __ATTR_RO(_name) { \ 115#define __ATTR_RO(_name) { \
116 .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ 116 .attr = { .name = __stringify(_name), .mode = 0444 }, \
117 .show = _name##_show, \ 117 .show = _name##_show, \
118} 118}
119 119
@@ -124,12 +124,11 @@ struct attribute_group {
124} 124}
125 125
126#define __ATTR_WO(_name) { \ 126#define __ATTR_WO(_name) { \
127 .attr = { .name = __stringify(_name), .mode = S_IWUSR }, \ 127 .attr = { .name = __stringify(_name), .mode = 0200 }, \
128 .store = _name##_store, \ 128 .store = _name##_store, \
129} 129}
130 130
131#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ 131#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store)
132 _name##_show, _name##_store)
133 132
134#define __ATTR_NULL { .attr = { .name = NULL } } 133#define __ATTR_NULL { .attr = { .name = NULL } }
135 134
@@ -192,14 +191,13 @@ struct bin_attribute {
192} 191}
193 192
194#define __BIN_ATTR_RO(_name, _size) { \ 193#define __BIN_ATTR_RO(_name, _size) { \
195 .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ 194 .attr = { .name = __stringify(_name), .mode = 0444 }, \
196 .read = _name##_read, \ 195 .read = _name##_read, \
197 .size = _size, \ 196 .size = _size, \
198} 197}
199 198
200#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \ 199#define __BIN_ATTR_RW(_name, _size) \
201 (S_IWUSR | S_IRUGO), _name##_read, \ 200 __BIN_ATTR(_name, 0644, _name##_read, _name##_write, _size)
202 _name##_write, _size)
203 201
204#define __BIN_ATTR_NULL __ATTR_NULL 202#define __BIN_ATTR_NULL __ATTR_NULL
205 203