aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/device.h5
-rw-r--r--include/linux/genhd.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 161d96241b1b..5c4495c8fe3f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -689,6 +689,11 @@ struct device {
689 void (*release)(struct device *dev); 689 void (*release)(struct device *dev);
690}; 690};
691 691
692static inline struct device *kobj_to_dev(struct kobject *kobj)
693{
694 return container_of(kobj, struct device, kobj);
695}
696
692/* Get the wakeup routines, which depend on struct device */ 697/* Get the wakeup routines, which depend on struct device */
693#include <linux/pm_wakeup.h> 698#include <linux/pm_wakeup.h>
694 699
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 017a7fb5a1fc..ae0aaa9d42fa 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -16,7 +16,6 @@
16 16
17#ifdef CONFIG_BLOCK 17#ifdef CONFIG_BLOCK
18 18
19#define kobj_to_dev(k) container_of((k), struct device, kobj)
20#define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev) 19#define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev)
21#define dev_to_part(device) container_of((device), struct hd_struct, __dev) 20#define dev_to_part(device) container_of((device), struct hd_struct, __dev)
22#define disk_to_dev(disk) (&(disk)->part0.__dev) 21#define disk_to_dev(disk) (&(disk)->part0.__dev)