aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 9e56745f87bf..99af4db5948b 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -87,7 +87,8 @@ static struct dma_chan *dev_to_dma_chan(struct device *dev)
87 return chan_dev->chan; 87 return chan_dev->chan;
88} 88}
89 89
90static ssize_t show_memcpy_count(struct device *dev, struct device_attribute *attr, char *buf) 90static ssize_t memcpy_count_show(struct device *dev,
91 struct device_attribute *attr, char *buf)
91{ 92{
92 struct dma_chan *chan; 93 struct dma_chan *chan;
93 unsigned long count = 0; 94 unsigned long count = 0;
@@ -106,9 +107,10 @@ static ssize_t show_memcpy_count(struct device *dev, struct device_attribute *at
106 107
107 return err; 108 return err;
108} 109}
110static DEVICE_ATTR_RO(memcpy_count);
109 111
110static ssize_t show_bytes_transferred(struct device *dev, struct device_attribute *attr, 112static ssize_t bytes_transferred_show(struct device *dev,
111 char *buf) 113 struct device_attribute *attr, char *buf)
112{ 114{
113 struct dma_chan *chan; 115 struct dma_chan *chan;
114 unsigned long count = 0; 116 unsigned long count = 0;
@@ -127,8 +129,10 @@ static ssize_t show_bytes_transferred(struct device *dev, struct device_attribut
127 129
128 return err; 130 return err;
129} 131}
132static DEVICE_ATTR_RO(bytes_transferred);
130 133
131static ssize_t show_in_use(struct device *dev, struct device_attribute *attr, char *buf) 134static ssize_t in_use_show(struct device *dev, struct device_attribute *attr,
135 char *buf)
132{ 136{
133 struct dma_chan *chan; 137 struct dma_chan *chan;
134 int err; 138 int err;
@@ -143,13 +147,15 @@ static ssize_t show_in_use(struct device *dev, struct device_attribute *attr, ch
143 147
144 return err; 148 return err;
145} 149}
150static DEVICE_ATTR_RO(in_use);
146 151
147static struct device_attribute dma_attrs[] = { 152static struct attribute *dma_dev_attrs[] = {
148 __ATTR(memcpy_count, S_IRUGO, show_memcpy_count, NULL), 153 &dev_attr_memcpy_count.attr,
149 __ATTR(bytes_transferred, S_IRUGO, show_bytes_transferred, NULL), 154 &dev_attr_bytes_transferred.attr,
150 __ATTR(in_use, S_IRUGO, show_in_use, NULL), 155 &dev_attr_in_use.attr,
151 __ATTR_NULL 156 NULL,
152}; 157};
158ATTRIBUTE_GROUPS(dma_dev);
153 159
154static void chan_dev_release(struct device *dev) 160static void chan_dev_release(struct device *dev)
155{ 161{
@@ -167,7 +173,7 @@ static void chan_dev_release(struct device *dev)
167 173
168static struct class dma_devclass = { 174static struct class dma_devclass = {
169 .name = "dma", 175 .name = "dma",
170 .dev_attrs = dma_attrs, 176 .dev_groups = dma_dev_groups,
171 .dev_release = chan_dev_release, 177 .dev_release = chan_dev_release,
172}; 178};
173 179