X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Flinux%2Fdevice.h;h=1a060265aceae6f31b2875d86f660dc9baaee1ab;hb=b0d19a378a409373244088511e889957645f2a44;hp=479c0b31593c6e3b6e5225144af1a51ae86534e0;hpb=9ef9dc69d4167276c04590d67ee55de8380bc1ad;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/device.h b/include/linux/device.h index 479c0b31593..1a060265ace 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -410,6 +410,15 @@ extern int devres_release_group(struct device *dev, void *id); extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); extern void devm_kfree(struct device *dev, void *p); +struct device_dma_parameters { + /* + * a low level driver may set these to teach IOMMU code about + * sg limitations. + */ + unsigned int max_segment_size; + unsigned long segment_boundary_mask; +}; + struct device { struct klist klist_children; struct klist_node knode_parent; /* node in sibling list */ @@ -420,7 +429,6 @@ struct device { struct kobject kobj; char bus_id[BUS_ID_SIZE]; /* position on parent bus */ struct device_type *type; - unsigned is_registered:1; unsigned uevent_suppress:1; struct semaphore sem; /* semaphore to synchronize calls to @@ -445,6 +453,8 @@ struct device { 64 bit addresses for consistent allocations such descriptors. */ + struct device_dma_parameters *dma_parms; + struct list_head dma_pools; /* dma pools (if dma'ble) */ struct dma_coherent_mem *dma_mem; /* internal for coherent mem @@ -464,6 +474,9 @@ struct device { void (*release)(struct device *dev); }; +/* Get the wakeup routines, which depend on struct device */ +#include + #ifdef CONFIG_NUMA static inline int dev_to_node(struct device *dev) { @@ -495,7 +508,7 @@ static inline void dev_set_drvdata(struct device *dev, void *data) static inline int device_is_registered(struct device *dev) { - return dev->is_registered; + return dev->kobj.state_in_sysfs; } void driver_init(void); @@ -532,20 +545,6 @@ extern struct device *device_create(struct class *cls, struct device *parent, dev_t devt, const char *fmt, ...) __attribute__((format(printf, 4, 5))); extern void device_destroy(struct class *cls, dev_t devt); -#ifdef CONFIG_PM_SLEEP -extern void destroy_suspended_device(struct class *cls, dev_t devt); -extern void device_pm_schedule_removal(struct device *); -#else /* !CONFIG_PM_SLEEP */ -static inline void destroy_suspended_device(struct class *cls, dev_t devt) -{ - device_destroy(cls, devt); -} - -static inline void device_pm_schedule_removal(struct device *dev) -{ - device_unregister(dev); -} -#endif /* !CONFIG_PM_SLEEP */ /* * Platform "fixup" functions - allow the platform to have their say @@ -597,21 +596,16 @@ extern const char *dev_driver_string(struct device *dev); #define dev_dbg(dev, format, arg...) \ dev_printk(KERN_DEBUG , dev , format , ## arg) #else -static inline int __attribute__ ((format (printf, 2, 3))) -dev_dbg(struct device *dev, const char *fmt, ...) -{ - return 0; -} +#define dev_dbg(dev, format, arg...) \ + ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) #endif #ifdef VERBOSE_DEBUG #define dev_vdbg dev_dbg #else -static inline int __attribute__ ((format (printf, 2, 3))) -dev_vdbg(struct device *dev, const char *fmt, ...) -{ - return 0; -} + +#define dev_vdbg(dev, format, arg...) \ + ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) #endif /* Create alias, so I can be autoloaded. */