aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 11:07:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 11:07:41 -0400
commit5da77761e6fd51f633b4f31051c4f839e01c29c0 (patch)
tree35c73a75901e9bc3a2e1489072ab32f107a085cb /include/linux
parent4046136afbd1038d776bad9c59e1e4cca78186fb (diff)
parentcda43576afa641d83ae268cb9795ae2a549d53d9 (diff)
Merge tag 'driver-core-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core into next
Pull driver core / kernfs changes from Greg KH: "Here is the "big" pull request for 3.16-rc1. Not a lot of changes here, some kernfs work, a revert of a very old driver core change that ended up cauing some memory leaks on driver probe error paths, and other minor things. As was pointed out earlier today, one commit here, 26fc9cd200ec ("kernfs: move the last knowledge of sysfs out from kernfs") is also needed in your 3.15-final branch as well. If you could cherry-pick it there, it would be most appreciated by Andy Lutomirski to prevent a regression there. All of these have been in linux-next for a while" * tag 'driver-core-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: crypto/nx/nx-842: dev_set_drvdata can no longer fail kernfs: move the last knowledge of sysfs out from kernfs sysfs: fix attribute_group bin file path on removal sysfs.h: don't return a void-valued expression in sysfs_remove_file init.h: Update initcall_sync variants to fix build errors driver core: Inline dev_set/get_drvdata driver core: dev_get_drvdata: Don't check for NULL dev driver core: dev_set_drvdata returns void driver core: dev_set_drvdata can no longer fail driver core: Move driver_data back to struct device lib/devres.c: fix checkpatch warnings lib/devres.c: use dev in devm_request_and_ioremap kobject: Make support for uevent_helper optional. kernfs: make kernfs_notify() trigger inotify events too kernfs: implement kernfs_root->supers list
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h15
-rw-r--r--include/linux/init.h14
-rw-r--r--include/linux/kernfs.h17
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/sysfs.h2
5 files changed, 41 insertions, 9 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index d1d1c055b48e..1b18c886445c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -673,6 +673,7 @@ struct acpi_dev_node {
673 * variants, which GPIO pins act in what additional roles, and so 673 * variants, which GPIO pins act in what additional roles, and so
674 * on. This shrinks the "Board Support Packages" (BSPs) and 674 * on. This shrinks the "Board Support Packages" (BSPs) and
675 * minimizes board-specific #ifdefs in drivers. 675 * minimizes board-specific #ifdefs in drivers.
676 * @driver_data: Private pointer for driver specific info.
676 * @power: For device power management. 677 * @power: For device power management.
677 * See Documentation/power/devices.txt for details. 678 * See Documentation/power/devices.txt for details.
678 * @pm_domain: Provide callbacks that are executed during system suspend, 679 * @pm_domain: Provide callbacks that are executed during system suspend,
@@ -734,6 +735,8 @@ struct device {
734 device */ 735 device */
735 void *platform_data; /* Platform specific data, device 736 void *platform_data; /* Platform specific data, device
736 core doesn't touch it */ 737 core doesn't touch it */
738 void *driver_data; /* Driver data, set and get with
739 dev_set/get_drvdata */
737 struct dev_pm_info power; 740 struct dev_pm_info power;
738 struct dev_pm_domain *pm_domain; 741 struct dev_pm_domain *pm_domain;
739 742
@@ -823,6 +826,16 @@ static inline void set_dev_node(struct device *dev, int node)
823} 826}
824#endif 827#endif
825 828
829static inline void *dev_get_drvdata(const struct device *dev)
830{
831 return dev->driver_data;
832}
833
834static inline void dev_set_drvdata(struct device *dev, void *data)
835{
836 dev->driver_data = data;
837}
838
826static inline struct pm_subsys_data *dev_to_psd(struct device *dev) 839static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
827{ 840{
828 return dev ? dev->power.subsys_data : NULL; 841 return dev ? dev->power.subsys_data : NULL;
@@ -907,8 +920,6 @@ extern int device_move(struct device *dev, struct device *new_parent,
907extern const char *device_get_devnode(struct device *dev, 920extern const char *device_get_devnode(struct device *dev,
908 umode_t *mode, kuid_t *uid, kgid_t *gid, 921 umode_t *mode, kuid_t *uid, kgid_t *gid,
909 const char **tmp); 922 const char **tmp);
910extern void *dev_get_drvdata(const struct device *dev);
911extern int dev_set_drvdata(struct device *dev, void *data);
912 923
913static inline bool device_supports_offline(struct device *dev) 924static inline bool device_supports_offline(struct device *dev)
914{ 925{
diff --git a/include/linux/init.h b/include/linux/init.h
index a3ba27076342..2df8e8dd10a4 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -297,16 +297,28 @@ void __init parse_early_options(char *cmdline);
297 297
298#else /* MODULE */ 298#else /* MODULE */
299 299
300/* Don't use these in loadable modules, but some people do... */ 300/*
301 * In most cases loadable modules do not need custom
302 * initcall levels. There are still some valid cases where
303 * a driver may be needed early if built in, and does not
304 * matter when built as a loadable module. Like bus
305 * snooping debug drivers.
306 */
301#define early_initcall(fn) module_init(fn) 307#define early_initcall(fn) module_init(fn)
302#define core_initcall(fn) module_init(fn) 308#define core_initcall(fn) module_init(fn)
309#define core_initcall_sync(fn) module_init(fn)
303#define postcore_initcall(fn) module_init(fn) 310#define postcore_initcall(fn) module_init(fn)
311#define postcore_initcall_sync(fn) module_init(fn)
304#define arch_initcall(fn) module_init(fn) 312#define arch_initcall(fn) module_init(fn)
305#define subsys_initcall(fn) module_init(fn) 313#define subsys_initcall(fn) module_init(fn)
314#define subsys_initcall_sync(fn) module_init(fn)
306#define fs_initcall(fn) module_init(fn) 315#define fs_initcall(fn) module_init(fn)
316#define fs_initcall_sync(fn) module_init(fn)
307#define rootfs_initcall(fn) module_init(fn) 317#define rootfs_initcall(fn) module_init(fn)
308#define device_initcall(fn) module_init(fn) 318#define device_initcall(fn) module_init(fn)
319#define device_initcall_sync(fn) module_init(fn)
309#define late_initcall(fn) module_init(fn) 320#define late_initcall(fn) module_init(fn)
321#define late_initcall_sync(fn) module_init(fn)
310 322
311#define console_initcall(fn) module_init(fn) 323#define console_initcall(fn) module_init(fn)
312#define security_initcall(fn) module_init(fn) 324#define security_initcall(fn) module_init(fn)
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index ca1be5c9136c..17aa1cce6f8e 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -161,6 +161,10 @@ struct kernfs_root {
161 /* private fields, do not use outside kernfs proper */ 161 /* private fields, do not use outside kernfs proper */
162 struct ida ino_ida; 162 struct ida ino_ida;
163 struct kernfs_syscall_ops *syscall_ops; 163 struct kernfs_syscall_ops *syscall_ops;
164
165 /* list of kernfs_super_info of this root, protected by kernfs_mutex */
166 struct list_head supers;
167
164 wait_queue_head_t deactivate_waitq; 168 wait_queue_head_t deactivate_waitq;
165}; 169};
166 170
@@ -297,8 +301,8 @@ void kernfs_notify(struct kernfs_node *kn);
297 301
298const void *kernfs_super_ns(struct super_block *sb); 302const void *kernfs_super_ns(struct super_block *sb);
299struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, 303struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
300 struct kernfs_root *root, bool *new_sb_created, 304 struct kernfs_root *root, unsigned long magic,
301 const void *ns); 305 bool *new_sb_created, const void *ns);
302void kernfs_kill_sb(struct super_block *sb); 306void kernfs_kill_sb(struct super_block *sb);
303 307
304void kernfs_init(void); 308void kernfs_init(void);
@@ -391,7 +395,8 @@ static inline const void *kernfs_super_ns(struct super_block *sb)
391 395
392static inline struct dentry * 396static inline struct dentry *
393kernfs_mount_ns(struct file_system_type *fs_type, int flags, 397kernfs_mount_ns(struct file_system_type *fs_type, int flags,
394 struct kernfs_root *root, bool *new_sb_created, const void *ns) 398 struct kernfs_root *root, unsigned long magic,
399 bool *new_sb_created, const void *ns)
395{ return ERR_PTR(-ENOSYS); } 400{ return ERR_PTR(-ENOSYS); }
396 401
397static inline void kernfs_kill_sb(struct super_block *sb) { } 402static inline void kernfs_kill_sb(struct super_block *sb) { }
@@ -449,9 +454,11 @@ static inline int kernfs_rename(struct kernfs_node *kn,
449 454
450static inline struct dentry * 455static inline struct dentry *
451kernfs_mount(struct file_system_type *fs_type, int flags, 456kernfs_mount(struct file_system_type *fs_type, int flags,
452 struct kernfs_root *root, bool *new_sb_created) 457 struct kernfs_root *root, unsigned long magic,
458 bool *new_sb_created)
453{ 459{
454 return kernfs_mount_ns(fs_type, flags, root, new_sb_created, NULL); 460 return kernfs_mount_ns(fs_type, flags, root,
461 magic, new_sb_created, NULL);
455} 462}
456 463
457#endif /* __LINUX_KERNFS_H */ 464#endif /* __LINUX_KERNFS_H */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index f896a33e8341..2d61b909f414 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -32,8 +32,10 @@
32#define UEVENT_NUM_ENVP 32 /* number of env pointers */ 32#define UEVENT_NUM_ENVP 32 /* number of env pointers */
33#define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ 33#define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */
34 34
35#ifdef CONFIG_UEVENT_HELPER
35/* path to the userspace helper executed on an event */ 36/* path to the userspace helper executed on an event */
36extern char uevent_helper[]; 37extern char uevent_helper[];
38#endif
37 39
38/* counter to tag the uevent, read only except for the kobject core */ 40/* counter to tag the uevent, read only except for the kobject core */
39extern u64 uevent_seqnum; 41extern u64 uevent_seqnum;
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 5ffaa3443712..f97d0dbb59fa 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -437,7 +437,7 @@ static inline int __must_check sysfs_create_file(struct kobject *kobj,
437static inline void sysfs_remove_file(struct kobject *kobj, 437static inline void sysfs_remove_file(struct kobject *kobj,
438 const struct attribute *attr) 438 const struct attribute *attr)
439{ 439{
440 return sysfs_remove_file_ns(kobj, attr, NULL); 440 sysfs_remove_file_ns(kobj, attr, NULL);
441} 441}
442 442
443static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target, 443static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target,