X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fdevice.h;fp=include%2Flinux%2Fdevice.h;h=58df18d9cd3ebe4f218d1d13d119293879a77088;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=1e5f30da98bc528b9ab9aaf629a673cb50e6f8ae;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/include/linux/device.h b/include/linux/device.h index 1e5f30da9..58df18d9c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -11,6 +11,7 @@ #ifndef _DEVICE_H_ #define _DEVICE_H_ +#include #include #include #include @@ -60,6 +61,11 @@ extern void bus_unregister(struct bus_type * bus); extern void bus_rescan_devices(struct bus_type * bus); +extern struct bus_type * get_bus(struct bus_type * bus); +extern void put_bus(struct bus_type * bus); + +extern struct bus_type * find_bus(char * name); + /* iterator helpers for buses */ int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, @@ -142,7 +148,6 @@ struct class { struct subsystem subsys; struct list_head children; - struct list_head devices; struct list_head interfaces; struct semaphore sem; /* locks both the children and interfaces lists */ @@ -159,6 +164,9 @@ struct class { extern int class_register(struct class *); extern void class_unregister(struct class *); +extern struct class * class_get(struct class *); +extern void class_put(struct class *); + struct class_attribute { struct attribute attr; @@ -192,7 +200,6 @@ extern int class_device_create_file(struct class_device *, * @node: for internal use by the driver core only. * @kobj: for internal use by the driver core only. * @devt_attr: for internal use by the driver core only. - * @groups: optional additional groups to be created * @dev: if set, a symlink to the struct device is created in the sysfs * directory for this struct class device. * @class_data: pointer to whatever you want to store here for this struct @@ -221,7 +228,6 @@ struct class_device { struct device * dev; /* not necessary, but nice to have */ void * class_data; /* class-specific data */ struct class_device *parent; /* parent of this child device, if there is one */ - struct attribute_group ** groups; /* optional groups */ void (*release)(struct class_device *dev); int (*uevent)(struct class_device *dev, char **envp, @@ -306,7 +312,6 @@ struct device { struct kobject kobj; char bus_id[BUS_ID_SIZE]; /* position on parent bus */ struct device_attribute uevent_attr; - struct device_attribute *devt_attr; struct semaphore sem; /* semaphore to synchronize calls to * its driver. @@ -334,11 +339,6 @@ struct device { struct dma_coherent_mem *dma_mem; /* internal for coherent mem override */ - /* class_device migration path */ - struct list_head node; - struct class *class; /* optional*/ - dev_t devt; /* dev_t, creates the sysfs "dev" */ - void (*release)(struct device * dev); }; @@ -378,15 +378,7 @@ extern void device_bind_driver(struct device * dev); extern void device_release_driver(struct device * dev); extern int device_attach(struct device * dev); extern void driver_attach(struct device_driver * drv); -extern void device_reprobe(struct device *dev); -/* - * Easy functions for dynamically creating devices on the fly - */ -extern struct device *device_create(struct class *cls, struct device *parent, - dev_t devt, char *fmt, ...) - __attribute__((format(printf,4,5))); -extern void device_destroy(struct class *cls, dev_t devt); /* * Platform "fixup" functions - allow the platform to have their say @@ -407,7 +399,7 @@ extern struct device * get_device(struct device * dev); extern void put_device(struct device * dev); -/* drivers/base/power/shutdown.c */ +/* drivers/base/power.c */ extern void device_shutdown(void); @@ -416,9 +408,8 @@ extern int firmware_register(struct subsystem *); extern void firmware_unregister(struct subsystem *); /* debugging and troubleshooting/diagnostic helpers. */ -extern const char *dev_driver_string(struct device *dev); #define dev_printk(level, dev, format, arg...) \ - printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg) + printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) #ifdef DEBUG #define dev_dbg(dev, format, arg...) \ @@ -433,8 +424,6 @@ extern const char *dev_driver_string(struct device *dev); dev_printk(KERN_INFO , dev , format , ## arg) #define dev_warn(dev, format, arg...) \ dev_printk(KERN_WARNING , dev , format , ## arg) -#define dev_notice(dev, format, arg...) \ - dev_printk(KERN_NOTICE , dev , format , ## arg) /* Create alias, so I can be autoloaded. */ #define MODULE_ALIAS_CHARDEV(major,minor) \