aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index c20dfbfc49b4..85e78fc7d7fd 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -33,6 +33,7 @@ struct class;
33struct subsys_private; 33struct subsys_private;
34struct bus_type; 34struct bus_type;
35struct device_node; 35struct device_node;
36struct iommu_ops;
36 37
37struct bus_attribute { 38struct bus_attribute {
38 struct attribute attr; 39 struct attribute attr;
@@ -67,6 +68,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
67 * @resume: Called to bring a device on this bus out of sleep mode. 68 * @resume: Called to bring a device on this bus out of sleep mode.
68 * @pm: Power management operations of this bus, callback the specific 69 * @pm: Power management operations of this bus, callback the specific
69 * device driver's pm-ops. 70 * device driver's pm-ops.
71 * @iommu_ops IOMMU specific operations for this bus, used to attach IOMMU
72 * driver implementations to a bus and allow the driver to do
73 * bus-specific setup
70 * @p: The private data of the driver core, only the driver core can 74 * @p: The private data of the driver core, only the driver core can
71 * touch this. 75 * touch this.
72 * 76 *
@@ -96,6 +100,8 @@ struct bus_type {
96 100
97 const struct dev_pm_ops *pm; 101 const struct dev_pm_ops *pm;
98 102
103 struct iommu_ops *iommu_ops;
104
99 struct subsys_private *p; 105 struct subsys_private *p;
100}; 106};
101 107
@@ -350,6 +356,8 @@ struct class_attribute {
350 char *buf); 356 char *buf);
351 ssize_t (*store)(struct class *class, struct class_attribute *attr, 357 ssize_t (*store)(struct class *class, struct class_attribute *attr,
352 const char *buf, size_t count); 358 const char *buf, size_t count);
359 const void *(*namespace)(struct class *class,
360 const struct class_attribute *attr);
353}; 361};
354 362
355#define CLASS_ATTR(_name, _mode, _show, _store) \ 363#define CLASS_ATTR(_name, _mode, _show, _store) \
@@ -636,6 +644,11 @@ static inline void set_dev_node(struct device *dev, int node)
636} 644}
637#endif 645#endif
638 646
647static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
648{
649 return dev ? dev->power.subsys_data : NULL;
650}
651
639static inline unsigned int dev_get_uevent_suppress(const struct device *dev) 652static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
640{ 653{
641 return dev->kobj.uevent_suppress; 654 return dev->kobj.uevent_suppress;
@@ -785,6 +798,8 @@ extern const char *dev_driver_string(const struct device *dev);
785 798
786#ifdef CONFIG_PRINTK 799#ifdef CONFIG_PRINTK
787 800
801extern int __dev_printk(const char *level, const struct device *dev,
802 struct va_format *vaf);
788extern int dev_printk(const char *level, const struct device *dev, 803extern int dev_printk(const char *level, const struct device *dev,
789 const char *fmt, ...) 804 const char *fmt, ...)
790 __attribute__ ((format (printf, 3, 4))); 805 __attribute__ ((format (printf, 3, 4)));
@@ -805,6 +820,9 @@ extern int _dev_info(const struct device *dev, const char *fmt, ...)
805 820
806#else 821#else
807 822
823static inline int __dev_printk(const char *level, const struct device *dev,
824 struct va_format *vaf)
825 { return 0; }
808static inline int dev_printk(const char *level, const struct device *dev, 826static inline int dev_printk(const char *level, const struct device *dev,
809 const char *fmt, ...) 827 const char *fmt, ...)
810 __attribute__ ((format (printf, 3, 4))); 828 __attribute__ ((format (printf, 3, 4)));