Commit 5b1530d9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Tomi Valkeinen

video: output: convert class code to use dev_groups

The dev_attrs field of struct class is going away soon, dev_groups
should be used instead.  This converts the video output class code to
use the correct field.

Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 3b2f64d0
...@@ -32,8 +32,8 @@ MODULE_DESCRIPTION("Display Output Switcher Lowlevel Control Abstraction"); ...@@ -32,8 +32,8 @@ MODULE_DESCRIPTION("Display Output Switcher Lowlevel Control Abstraction");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>"); MODULE_AUTHOR("Luming Yu <luming.yu@intel.com>");
static ssize_t video_output_show_state(struct device *dev, static ssize_t state_show(struct device *dev, struct device_attribute *attr,
struct device_attribute *attr, char *buf) char *buf)
{ {
ssize_t ret_size = 0; ssize_t ret_size = 0;
struct output_device *od = to_output_device(dev); struct output_device *od = to_output_device(dev);
...@@ -42,9 +42,8 @@ static ssize_t video_output_show_state(struct device *dev, ...@@ -42,9 +42,8 @@ static ssize_t video_output_show_state(struct device *dev,
return ret_size; return ret_size;
} }
static ssize_t video_output_store_state(struct device *dev, static ssize_t state_store(struct device *dev, struct device_attribute *attr,
struct device_attribute *attr, const char *buf,size_t count)
const char *buf,size_t count)
{ {
char *endp; char *endp;
struct output_device *od = to_output_device(dev); struct output_device *od = to_output_device(dev);
...@@ -62,6 +61,7 @@ static ssize_t video_output_store_state(struct device *dev, ...@@ -62,6 +61,7 @@ static ssize_t video_output_store_state(struct device *dev,
} }
return count; return count;
} }
static DEVICE_ATTR_RW(state);
static void video_output_release(struct device *dev) static void video_output_release(struct device *dev)
{ {
...@@ -69,16 +69,16 @@ static void video_output_release(struct device *dev) ...@@ -69,16 +69,16 @@ static void video_output_release(struct device *dev)
kfree(od); kfree(od);
} }
static struct device_attribute video_output_attributes[] = { static struct attribute *video_output_attrs[] = {
__ATTR(state, 0644, video_output_show_state, video_output_store_state), &dev_attr_state.attr,
__ATTR_NULL, NULL,
}; };
ATTRIBUTE_GROUPS(video_output);
static struct class video_output_class = { static struct class video_output_class = {
.name = "video_output", .name = "video_output",
.dev_release = video_output_release, .dev_release = video_output_release,
.dev_attrs = video_output_attributes, .dev_groups = video_output_groups,
}; };
struct output_device *video_output_register(const char *name, struct output_device *video_output_register(const char *name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment