diff options
author | tonyj@suse.de <tonyj@suse.de> | 2007-08-08 01:28:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:51:04 -0400 |
commit | 60043428a561a5d431ad479b7ecb79805ed04efc (patch) | |
tree | 3e143a2a4872987c38719fd07d18940d2acd77c5 /drivers | |
parent | 34b51f39e23bc9e529830ddf6108381d4bab95a6 (diff) |
Convert from class_device to device for drivers/video
Convert from class_device to device for drivers/video.
Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/video.c | 4 | ||||
-rw-r--r-- | drivers/video/output.c | 29 |
2 files changed, 18 insertions, 15 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index d05891f16282..b8a2095cb5ee 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -316,7 +316,7 @@ static int acpi_video_output_get(struct output_device *od) | |||
316 | { | 316 | { |
317 | unsigned long state; | 317 | unsigned long state; |
318 | struct acpi_video_device *vd = | 318 | struct acpi_video_device *vd = |
319 | (struct acpi_video_device *)class_get_devdata(&od->class_dev); | 319 | (struct acpi_video_device *)dev_get_drvdata(&od->dev); |
320 | acpi_video_device_get_state(vd, &state); | 320 | acpi_video_device_get_state(vd, &state); |
321 | return (int)state; | 321 | return (int)state; |
322 | } | 322 | } |
@@ -325,7 +325,7 @@ static int acpi_video_output_set(struct output_device *od) | |||
325 | { | 325 | { |
326 | unsigned long state = od->request_state; | 326 | unsigned long state = od->request_state; |
327 | struct acpi_video_device *vd= | 327 | struct acpi_video_device *vd= |
328 | (struct acpi_video_device *)class_get_devdata(&od->class_dev); | 328 | (struct acpi_video_device *)dev_get_drvdata(&od->dev); |
329 | return acpi_video_device_set_state(vd, state); | 329 | return acpi_video_device_set_state(vd, state); |
330 | } | 330 | } |
331 | 331 | ||
diff --git a/drivers/video/output.c b/drivers/video/output.c index 1473f2c892d2..f2df5519c9c4 100644 --- a/drivers/video/output.c +++ b/drivers/video/output.c | |||
@@ -31,7 +31,8 @@ MODULE_DESCRIPTION("Display Output Switcher Lowlevel Control Abstraction"); | |||
31 | MODULE_LICENSE("GPL"); | 31 | MODULE_LICENSE("GPL"); |
32 | MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>"); | 32 | MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>"); |
33 | 33 | ||
34 | static ssize_t video_output_show_state(struct class_device *dev,char *buf) | 34 | static ssize_t video_output_show_state(struct device *dev, |
35 | struct device_attribute *attr, char *buf) | ||
35 | { | 36 | { |
36 | ssize_t ret_size = 0; | 37 | ssize_t ret_size = 0; |
37 | struct output_device *od = to_output_device(dev); | 38 | struct output_device *od = to_output_device(dev); |
@@ -40,8 +41,9 @@ static ssize_t video_output_show_state(struct class_device *dev,char *buf) | |||
40 | return ret_size; | 41 | return ret_size; |
41 | } | 42 | } |
42 | 43 | ||
43 | static ssize_t video_output_store_state(struct class_device *dev, | 44 | static ssize_t video_output_store_state(struct device *dev, |
44 | const char *buf,size_t count) | 45 | struct device_attribute *attr, |
46 | const char *buf,size_t count) | ||
45 | { | 47 | { |
46 | char *endp; | 48 | char *endp; |
47 | struct output_device *od = to_output_device(dev); | 49 | struct output_device *od = to_output_device(dev); |
@@ -60,21 +62,22 @@ static ssize_t video_output_store_state(struct class_device *dev, | |||
60 | return count; | 62 | return count; |
61 | } | 63 | } |
62 | 64 | ||
63 | static void video_output_class_release(struct class_device *dev) | 65 | static void video_output_release(struct device *dev) |
64 | { | 66 | { |
65 | struct output_device *od = to_output_device(dev); | 67 | struct output_device *od = to_output_device(dev); |
66 | kfree(od); | 68 | kfree(od); |
67 | } | 69 | } |
68 | 70 | ||
69 | static struct class_device_attribute video_output_attributes[] = { | 71 | static struct device_attribute video_output_attributes[] = { |
70 | __ATTR(state, 0644, video_output_show_state, video_output_store_state), | 72 | __ATTR(state, 0644, video_output_show_state, video_output_store_state), |
71 | __ATTR_NULL, | 73 | __ATTR_NULL, |
72 | }; | 74 | }; |
73 | 75 | ||
76 | |||
74 | static struct class video_output_class = { | 77 | static struct class video_output_class = { |
75 | .name = "video_output", | 78 | .name = "video_output", |
76 | .release = video_output_class_release, | 79 | .dev_release = video_output_release, |
77 | .class_dev_attrs = video_output_attributes, | 80 | .dev_attrs = video_output_attributes, |
78 | }; | 81 | }; |
79 | 82 | ||
80 | struct output_device *video_output_register(const char *name, | 83 | struct output_device *video_output_register(const char *name, |
@@ -91,11 +94,11 @@ struct output_device *video_output_register(const char *name, | |||
91 | goto error_return; | 94 | goto error_return; |
92 | } | 95 | } |
93 | new_dev->props = op; | 96 | new_dev->props = op; |
94 | new_dev->class_dev.class = &video_output_class; | 97 | new_dev->dev.class = &video_output_class; |
95 | new_dev->class_dev.dev = dev; | 98 | new_dev->dev.parent = dev; |
96 | strlcpy(new_dev->class_dev.class_id,name,KOBJ_NAME_LEN); | 99 | strlcpy(new_dev->dev.bus_id,name, BUS_ID_SIZE); |
97 | class_set_devdata(&new_dev->class_dev,devdata); | 100 | dev_set_drvdata(&new_dev->dev, devdata); |
98 | ret_code = class_device_register(&new_dev->class_dev); | 101 | ret_code = device_register(&new_dev->dev); |
99 | if (ret_code) { | 102 | if (ret_code) { |
100 | kfree(new_dev); | 103 | kfree(new_dev); |
101 | goto error_return; | 104 | goto error_return; |
@@ -111,7 +114,7 @@ void video_output_unregister(struct output_device *dev) | |||
111 | { | 114 | { |
112 | if (!dev) | 115 | if (!dev) |
113 | return; | 116 | return; |
114 | class_device_unregister(&dev->class_dev); | 117 | device_unregister(&dev->dev); |
115 | } | 118 | } |
116 | EXPORT_SYMBOL(video_output_unregister); | 119 | EXPORT_SYMBOL(video_output_unregister); |
117 | 120 | ||