base.h 2.02 KB
Newer Older
Patrick Mochel's avatar
Patrick Mochel committed
1 2 3 4 5 6 7 8
#undef DEBUG

#ifdef DEBUG
# define DBG(x...) printk(x)
#else
# define DBG(x...)
#endif

9
extern struct list_head global_device_list;
Patrick Mochel's avatar
Patrick Mochel committed
10
extern spinlock_t device_lock;
11
extern struct semaphore device_sem;
Patrick Mochel's avatar
Patrick Mochel committed
12

13 14
extern struct device * get_device_locked(struct device *);

15 16 17
extern int bus_add_device(struct device * dev);
extern void bus_remove_device(struct device * dev);

Patrick Mochel's avatar
Patrick Mochel committed
18 19 20
extern int device_make_dir(struct device * dev);
extern void device_remove_dir(struct device * dev);

21 22 23
extern int bus_make_dir(struct bus_type * bus);
extern void bus_remove_dir(struct bus_type * bus);

24 25 26
extern int bus_add_driver(struct device_driver *);
extern void bus_remove_driver(struct device_driver *);

27 28 29
extern int driver_make_dir(struct device_driver * drv);
extern void driver_remove_dir(struct device_driver * drv);

30
extern int device_bus_link(struct device * dev);
31
extern void device_remove_symlink(struct driver_dir_entry * dir, const char * name);
32

33 34 35 36 37 38 39 40 41
extern int devclass_make_dir(struct device_class *);
extern void devclass_remove_dir(struct device_class *);

extern int devclass_drv_link(struct device_driver *);
extern void devclass_drv_unlink(struct device_driver *);

extern int devclass_dev_link(struct device_class *, struct device *);
extern void devclass_dev_unlink(struct device_class *, struct device *);

42 43 44 45 46 47 48 49 50 51 52 53 54
extern int devclass_add_device(struct device *);
extern void devclass_remove_device(struct device *);

extern int intf_make_dir(struct device_interface *);
extern void intf_remove_dir(struct device_interface *);

extern int intf_dev_link(struct intf_data *);
extern void intf_dev_unlink(struct intf_data *);

extern int interface_add(struct device_class *, struct device *);
extern void interface_remove(struct device_class *, struct device *);


55 56
#ifdef CONFIG_HOTPLUG
extern int dev_hotplug(struct device *dev, const char *action);
57
extern int class_hotplug(struct device *dev, const char *action);
58 59 60 61 62
#else
static inline int dev_hotplug(struct device *dev, const char *action)
{
	return 0;
}
63 64 65 66
static int class_hotplug(struct device *dev, const char *action)
{
	return 0;
}
67 68
#endif