From 6f614c99601d8d5f2b67a186806bbd21e5108fc5 Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Tue, 3 Dec 2002 00:40:21 -0600 Subject: driver model: clean up interface handling. - Make sure devices are added to an interface if the interface is registered e.g. as a module. - Make sure interface data descriptors are inserted into the interface's list by adding a kobject to them and calling kobject_register. - Create interface_remove_data() for explicit removal of data descriptor. - Break common pieces into separate functions. - Add lots of comments. - Add class_list to struct device, so we can access the devices registered with the class. --- include/linux/device.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/linux/device.h') diff --git a/include/linux/device.h b/include/linux/device.h index c1918942c4cd..48612267bd65 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -168,6 +168,7 @@ struct device_class { struct subsystem devsubsys; struct subsystem drvsubsys; struct list_head drivers; + struct list_head devices; int (*add_device)(struct device *); void (*remove_device)(struct device *); @@ -216,9 +217,7 @@ struct device_interface { char * name; struct device_class * devclass; - struct kobject kobj; - struct list_head devices; - + struct subsystem subsys; u32 devnum; int (*add_device) (struct device *); @@ -239,10 +238,11 @@ extern void interface_unregister(struct device_interface *); * and create a driverfs symlink for it. */ struct intf_data { - struct list_head node; struct device_interface * intf; struct device * dev; u32 intf_num; + struct list_head dev_entry; + struct kobject kobj; }; extern int interface_add_data(struct intf_data *); @@ -252,6 +252,7 @@ extern int interface_add_data(struct intf_data *); struct device { struct list_head node; /* node in sibling list */ struct list_head bus_list; /* node in bus's list */ + struct list_head class_list; struct list_head driver_list; struct list_head children; struct list_head intf_list; -- cgit v1.2.3