Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+16 -10
+16 -10
drivers/dma/dmaengine.c
··· 87 87 return chan_dev->chan; 88 88 } 89 89 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) 91 92 { 92 93 struct dma_chan *chan; 93 94 unsigned long count = 0; ··· 107 106 108 107 return err; 109 108 } 109 + static DEVICE_ATTR_RO(memcpy_count); 110 110 111 - static ssize_t show_bytes_transferred(struct device *dev, struct device_attribute *attr, 112 - char *buf) 111 + static ssize_t bytes_transferred_show(struct device *dev, 112 + struct device_attribute *attr, char *buf) 113 113 { 114 114 struct dma_chan *chan; 115 115 unsigned long count = 0; ··· 129 127 130 128 return err; 131 129 } 130 + static DEVICE_ATTR_RO(bytes_transferred); 132 131 133 - static ssize_t show_in_use(struct device *dev, struct device_attribute *attr, char *buf) 132 + static ssize_t in_use_show(struct device *dev, struct device_attribute *attr, 133 + char *buf) 134 134 { 135 135 struct dma_chan *chan; 136 136 int err; ··· 147 143 148 144 return err; 149 145 } 146 + static DEVICE_ATTR_RO(in_use); 150 147 151 - static struct device_attribute dma_attrs[] = { 152 - __ATTR(memcpy_count, S_IRUGO, show_memcpy_count, NULL), 153 - __ATTR(bytes_transferred, S_IRUGO, show_bytes_transferred, NULL), 154 - __ATTR(in_use, S_IRUGO, show_in_use, NULL), 155 - __ATTR_NULL 148 + static struct attribute *dma_dev_attrs[] = { 149 + &dev_attr_memcpy_count.attr, 150 + &dev_attr_bytes_transferred.attr, 151 + &dev_attr_in_use.attr, 152 + NULL, 156 153 }; 154 + ATTRIBUTE_GROUPS(dma_dev); 157 155 158 156 static void chan_dev_release(struct device *dev) 159 157 { ··· 173 167 174 168 static struct class dma_devclass = { 175 169 .name = "dma", 176 - .dev_attrs = dma_attrs, 170 + .dev_groups = dma_dev_groups, 177 171 .dev_release = chan_dev_release, 178 172 }; 179 173