diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:39:04 -0400 |
commit | e017a84b9397f50e22ba219d0b2875bf48a6573f (patch) | |
tree | fe92c28730ec985a3abc5ab41a42f9cd30dd09c9 /drivers/char/tile-srom.c | |
parent | 62e13505b4eff7a0e94bdcb1f4fd76cbe4a96ff1 (diff) |
tile: srom: convert srom_class to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the tile srom_class code to use
the correct field.
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/tile-srom.c')
-rw-r--r-- | drivers/char/tile-srom.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c index 7faeb1cde97d..344e97b91014 100644 --- a/drivers/char/tile-srom.c +++ b/drivers/char/tile-srom.c | |||
@@ -279,33 +279,37 @@ loff_t srom_llseek(struct file *file, loff_t offset, int origin) | |||
279 | return fixed_size_llseek(file, offset, origin, srom->total_size); | 279 | return fixed_size_llseek(file, offset, origin, srom->total_size); |
280 | } | 280 | } |
281 | 281 | ||
282 | static ssize_t total_show(struct device *dev, | 282 | static ssize_t total_size_show(struct device *dev, |
283 | struct device_attribute *attr, char *buf) | 283 | struct device_attribute *attr, char *buf) |
284 | { | 284 | { |
285 | struct srom_dev *srom = dev_get_drvdata(dev); | 285 | struct srom_dev *srom = dev_get_drvdata(dev); |
286 | return sprintf(buf, "%u\n", srom->total_size); | 286 | return sprintf(buf, "%u\n", srom->total_size); |
287 | } | 287 | } |
288 | static DEVICE_ATTR_RO(total_size); | ||
288 | 289 | ||
289 | static ssize_t sector_show(struct device *dev, | 290 | static ssize_t sector_size_show(struct device *dev, |
290 | struct device_attribute *attr, char *buf) | 291 | struct device_attribute *attr, char *buf) |
291 | { | 292 | { |
292 | struct srom_dev *srom = dev_get_drvdata(dev); | 293 | struct srom_dev *srom = dev_get_drvdata(dev); |
293 | return sprintf(buf, "%u\n", srom->sector_size); | 294 | return sprintf(buf, "%u\n", srom->sector_size); |
294 | } | 295 | } |
296 | static DEVICE_ATTR_RO(sector_size); | ||
295 | 297 | ||
296 | static ssize_t page_show(struct device *dev, | 298 | static ssize_t page_size_show(struct device *dev, |
297 | struct device_attribute *attr, char *buf) | 299 | struct device_attribute *attr, char *buf) |
298 | { | 300 | { |
299 | struct srom_dev *srom = dev_get_drvdata(dev); | 301 | struct srom_dev *srom = dev_get_drvdata(dev); |
300 | return sprintf(buf, "%u\n", srom->page_size); | 302 | return sprintf(buf, "%u\n", srom->page_size); |
301 | } | 303 | } |
304 | static DEVICE_ATTR_RO(page_size); | ||
302 | 305 | ||
303 | static struct device_attribute srom_dev_attrs[] = { | 306 | static struct attribute srom_dev_attrs[] = { |
304 | __ATTR(total_size, S_IRUGO, total_show, NULL), | 307 | &dev_attr_total_size.attr, |
305 | __ATTR(sector_size, S_IRUGO, sector_show, NULL), | 308 | &dev_attr_sector_size.attr, |
306 | __ATTR(page_size, S_IRUGO, page_show, NULL), | 309 | &dev_attr_page_size.attr, |
307 | __ATTR_NULL | 310 | NULL, |
308 | }; | 311 | }; |
312 | ATTRIBUTE_GROUPS(srom_dev); | ||
309 | 313 | ||
310 | static char *srom_devnode(struct device *dev, umode_t *mode) | 314 | static char *srom_devnode(struct device *dev, umode_t *mode) |
311 | { | 315 | { |
@@ -418,7 +422,7 @@ static int srom_init(void) | |||
418 | result = PTR_ERR(srom_class); | 422 | result = PTR_ERR(srom_class); |
419 | goto fail_cdev; | 423 | goto fail_cdev; |
420 | } | 424 | } |
421 | srom_class->dev_attrs = srom_dev_attrs; | 425 | srom_class->dev_groups = srom_dev_groups; |
422 | srom_class->devnode = srom_devnode; | 426 | srom_class->devnode = srom_devnode; |
423 | 427 | ||
424 | /* Do per-partition initialization */ | 428 | /* Do per-partition initialization */ |