Skip to content

Commit 58b267d

Browse files
committed
dma: convert dma_devclass to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the dma dma_devclass code to use the correct field. Cc: Dan Williams <djbw@fb.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c817a67 commit 58b267d

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

‎drivers/dma/dmaengine.c‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ static struct dma_chan *dev_to_dma_chan(struct device *dev)
8787
return chan_dev->chan;
8888
}
8989

90-
static ssize_t show_memcpy_count(struct device *dev, struct device_attribute *attr, char *buf)
90+
static ssize_t memcpy_count_show(struct device *dev,
91+
struct device_attribute *attr, char *buf)
9192
{
9293
struct dma_chan *chan;
9394
unsigned long count = 0;
@@ -106,9 +107,10 @@ static ssize_t show_memcpy_count(struct device *dev, struct device_attribute *at
106107

107108
return err;
108109
}
110+
static DEVICE_ATTR_RO(memcpy_count);
109111

110-
static ssize_t show_bytes_transferred(struct device *dev, struct device_attribute *attr,
111-
char *buf)
112+
static ssize_t bytes_transferred_show(struct device *dev,
113+
struct device_attribute *attr, char *buf)
112114
{
113115
struct dma_chan *chan;
114116
unsigned long count = 0;
@@ -127,8 +129,10 @@ static ssize_t show_bytes_transferred(struct device *dev, struct device_attribut
127129

128130
return err;
129131
}
132+
static DEVICE_ATTR_RO(bytes_transferred);
130133

131-
static ssize_t show_in_use(struct device *dev, struct device_attribute *attr, char *buf)
134+
static ssize_t in_use_show(struct device *dev, struct device_attribute *attr,
135+
char *buf)
132136
{
133137
struct dma_chan *chan;
134138
int err;
@@ -143,13 +147,15 @@ static ssize_t show_in_use(struct device *dev, struct device_attribute *attr, ch
143147

144148
return err;
145149
}
150+
static DEVICE_ATTR_RO(in_use);
146151

147-
static struct device_attribute dma_attrs[] = {
148-
__ATTR(memcpy_count, S_IRUGO, show_memcpy_count, NULL),
149-
__ATTR(bytes_transferred, S_IRUGO, show_bytes_transferred, NULL),
150-
__ATTR(in_use, S_IRUGO, show_in_use, NULL),
151-
__ATTR_NULL
152+
static struct attribute *dma_dev_attrs[] = {
153+
&dev_attr_memcpy_count.attr,
154+
&dev_attr_bytes_transferred.attr,
155+
&dev_attr_in_use.attr,
156+
NULL,
152157
};
158+
ATTRIBUTE_GROUPS(dma_dev);
153159

154160
static void chan_dev_release(struct device *dev)
155161
{
@@ -167,7 +173,7 @@ static void chan_dev_release(struct device *dev)
167173

168174
static struct class dma_devclass = {
169175
.name = "dma",
170-
.dev_attrs = dma_attrs,
176+
.dev_groups = dma_dev_groups,
171177
.dev_release = chan_dev_release,
172178
};
173179

0 commit comments

Comments
 (0)