aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/output.c')
-rw-r--r--drivers/video/output.c29
1 files changed, 16 insertions, 13 deletions
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");
31MODULE_LICENSE("GPL"); 31MODULE_LICENSE("GPL");
32MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>"); 32MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>");
33 33
34static ssize_t video_output_show_state(struct class_device *dev,char *buf) 34static 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
43static ssize_t video_output_store_state(struct class_device *dev, 44static 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
63static void video_output_class_release(struct class_device *dev) 65static 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
69static struct class_device_attribute video_output_attributes[] = { 71static 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
74static struct class video_output_class = { 77static 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
80struct output_device *video_output_register(const char *name, 83struct 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}
116EXPORT_SYMBOL(video_output_unregister); 119EXPORT_SYMBOL(video_output_unregister);
117 120