diff options
author | Wanlong Gao <wanlong.gao@gmail.com> | 2011-05-04 19:55:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-06 21:01:05 -0400 |
commit | 63dc355a5a8cf296e2b1cc2e4192190dca221129 (patch) | |
tree | 6dc32f94ef4bb41197e9dbdd73b416afc16ca874 /Documentation/driver-model | |
parent | 880ffb5c6c5c8c8c6efd9efe9355317322b4603b (diff) |
driver core: remove the driver-model structures from the documentation
Remove the struct bus_type, class, device, device_driver from the
driver-model docs. With another patch add them to device.h, since
they are out of date. That will keep things up to date and provide
a better way to document this stuff.
Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com>
Acked-by: Harry Wei <harryxiyou@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation/driver-model')
-rw-r--r-- | Documentation/driver-model/bus.txt | 19 | ||||
-rw-r--r-- | Documentation/driver-model/class.txt | 17 | ||||
-rw-r--r-- | Documentation/driver-model/device.txt | 91 | ||||
-rw-r--r-- | Documentation/driver-model/driver.txt | 18 |
4 files changed, 4 insertions, 141 deletions
diff --git a/Documentation/driver-model/bus.txt b/Documentation/driver-model/bus.txt index 5001b7511626..6754b2df8aa1 100644 --- a/Documentation/driver-model/bus.txt +++ b/Documentation/driver-model/bus.txt | |||
@@ -3,24 +3,7 @@ Bus Types | |||
3 | 3 | ||
4 | Definition | 4 | Definition |
5 | ~~~~~~~~~~ | 5 | ~~~~~~~~~~ |
6 | 6 | See the kerneldoc for the struct bus_type. | |
7 | struct bus_type { | ||
8 | char * name; | ||
9 | |||
10 | struct subsystem subsys; | ||
11 | struct kset drivers; | ||
12 | struct kset devices; | ||
13 | |||
14 | struct bus_attribute * bus_attrs; | ||
15 | struct device_attribute * dev_attrs; | ||
16 | struct driver_attribute * drv_attrs; | ||
17 | |||
18 | int (*match)(struct device * dev, struct device_driver * drv); | ||
19 | int (*hotplug) (struct device *dev, char **envp, | ||
20 | int num_envp, char *buffer, int buffer_size); | ||
21 | int (*suspend)(struct device * dev, pm_message_t state); | ||
22 | int (*resume)(struct device * dev); | ||
23 | }; | ||
24 | 7 | ||
25 | int bus_register(struct bus_type * bus); | 8 | int bus_register(struct bus_type * bus); |
26 | 9 | ||
diff --git a/Documentation/driver-model/class.txt b/Documentation/driver-model/class.txt index 548505f14aa4..1fefc480a80b 100644 --- a/Documentation/driver-model/class.txt +++ b/Documentation/driver-model/class.txt | |||
@@ -27,22 +27,7 @@ The device class structure looks like: | |||
27 | typedef int (*devclass_add)(struct device *); | 27 | typedef int (*devclass_add)(struct device *); |
28 | typedef void (*devclass_remove)(struct device *); | 28 | typedef void (*devclass_remove)(struct device *); |
29 | 29 | ||
30 | struct device_class { | 30 | See the kerneldoc for the struct class. |
31 | char * name; | ||
32 | rwlock_t lock; | ||
33 | u32 devnum; | ||
34 | struct list_head node; | ||
35 | |||
36 | struct list_head drivers; | ||
37 | struct list_head intf_list; | ||
38 | |||
39 | struct driver_dir_entry dir; | ||
40 | struct driver_dir_entry device_dir; | ||
41 | struct driver_dir_entry driver_dir; | ||
42 | |||
43 | devclass_add add_device; | ||
44 | devclass_remove remove_device; | ||
45 | }; | ||
46 | 31 | ||
47 | A typical device class definition would look like: | 32 | A typical device class definition would look like: |
48 | 33 | ||
diff --git a/Documentation/driver-model/device.txt b/Documentation/driver-model/device.txt index a124f3126b0d..b2ff42685bcb 100644 --- a/Documentation/driver-model/device.txt +++ b/Documentation/driver-model/device.txt | |||
@@ -2,96 +2,7 @@ | |||
2 | The Basic Device Structure | 2 | The Basic Device Structure |
3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
4 | 4 | ||
5 | struct device { | 5 | See the kerneldoc for the struct device. |
6 | struct list_head g_list; | ||
7 | struct list_head node; | ||
8 | struct list_head bus_list; | ||
9 | struct list_head driver_list; | ||
10 | struct list_head intf_list; | ||
11 | struct list_head children; | ||
12 | struct device * parent; | ||
13 | |||
14 | char name[DEVICE_NAME_SIZE]; | ||
15 | char bus_id[BUS_ID_SIZE]; | ||
16 | |||
17 | spinlock_t lock; | ||
18 | atomic_t refcount; | ||
19 | |||
20 | struct bus_type * bus; | ||
21 | struct driver_dir_entry dir; | ||
22 | |||
23 | u32 class_num; | ||
24 | |||
25 | struct device_driver *driver; | ||
26 | void *driver_data; | ||
27 | void *platform_data; | ||
28 | |||
29 | u32 current_state; | ||
30 | unsigned char *saved_state; | ||
31 | |||
32 | void (*release)(struct device * dev); | ||
33 | }; | ||
34 | |||
35 | Fields | ||
36 | ~~~~~~ | ||
37 | g_list: Node in the global device list. | ||
38 | |||
39 | node: Node in device's parent's children list. | ||
40 | |||
41 | bus_list: Node in device's bus's devices list. | ||
42 | |||
43 | driver_list: Node in device's driver's devices list. | ||
44 | |||
45 | intf_list: List of intf_data. There is one structure allocated for | ||
46 | each interface that the device supports. | ||
47 | |||
48 | children: List of child devices. | ||
49 | |||
50 | parent: *** FIXME *** | ||
51 | |||
52 | name: ASCII description of device. | ||
53 | Example: " 3Com Corporation 3c905 100BaseTX [Boomerang]" | ||
54 | |||
55 | bus_id: ASCII representation of device's bus position. This | ||
56 | field should be a name unique across all devices on the | ||
57 | bus type the device belongs to. | ||
58 | |||
59 | Example: PCI bus_ids are in the form of | ||
60 | <bus number>:<slot number>.<function number> | ||
61 | This name is unique across all PCI devices in the system. | ||
62 | |||
63 | lock: Spinlock for the device. | ||
64 | |||
65 | refcount: Reference count on the device. | ||
66 | |||
67 | bus: Pointer to struct bus_type that device belongs to. | ||
68 | |||
69 | dir: Device's sysfs directory. | ||
70 | |||
71 | class_num: Class-enumerated value of the device. | ||
72 | |||
73 | driver: Pointer to struct device_driver that controls the device. | ||
74 | |||
75 | driver_data: Driver-specific data. | ||
76 | |||
77 | platform_data: Platform data specific to the device. | ||
78 | |||
79 | Example: for devices on custom boards, as typical of embedded | ||
80 | and SOC based hardware, Linux often uses platform_data to point | ||
81 | to board-specific structures describing devices and how they | ||
82 | are wired. That can include what ports are available, chip | ||
83 | variants, which GPIO pins act in what additional roles, and so | ||
84 | on. This shrinks the "Board Support Packages" (BSPs) and | ||
85 | minimizes board-specific #ifdefs in drivers. | ||
86 | |||
87 | current_state: Current power state of the device. | ||
88 | |||
89 | saved_state: Pointer to saved state of the device. This is usable by | ||
90 | the device driver controlling the device. | ||
91 | |||
92 | release: Callback to free the device after all references have | ||
93 | gone away. This should be set by the allocator of the | ||
94 | device (i.e. the bus driver that discovered the device). | ||
95 | 6 | ||
96 | 7 | ||
97 | Programming Interface | 8 | Programming Interface |
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt index d2cd6fb8ba9e..4421135826a2 100644 --- a/Documentation/driver-model/driver.txt +++ b/Documentation/driver-model/driver.txt | |||
@@ -1,23 +1,7 @@ | |||
1 | 1 | ||
2 | Device Drivers | 2 | Device Drivers |
3 | 3 | ||
4 | struct device_driver { | 4 | See the kerneldoc for the struct device_driver. |
5 | char * name; | ||
6 | struct bus_type * bus; | ||
7 | |||
8 | struct completion unloaded; | ||
9 | struct kobject kobj; | ||
10 | list_t devices; | ||
11 | |||
12 | struct module *owner; | ||
13 | |||
14 | int (*probe) (struct device * dev); | ||
15 | int (*remove) (struct device * dev); | ||
16 | |||
17 | int (*suspend) (struct device * dev, pm_message_t state); | ||
18 | int (*resume) (struct device * dev); | ||
19 | }; | ||
20 | |||
21 | 5 | ||
22 | 6 | ||
23 | Allocation | 7 | Allocation |