aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:31:58 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:31:58 -0500
commite11b9035a47da66fcd4bafd3a5f6b14f51ca667e (patch)
tree060ba965247b2c3f31ec2873a9669cadb31d9ac8
parent1b7d3477a7b0d52406d68b01bc8931f43112677f (diff)
ide: add /sys/bus/ide/devices/*/{model,firmware,serial} sysfs entries
Cc: Dan Kegel <dank@kegel.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Xavier Bestel <xavier.bestel@free.fr> Cc: Andrey Borzenkov <arvidjaar@mail.ru> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 674a65c1a130..85740ae5d689 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1670,10 +1670,34 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
1670 return sprintf(buf, "ide:m-%s\n", media_string(drive)); 1670 return sprintf(buf, "ide:m-%s\n", media_string(drive));
1671} 1671}
1672 1672
1673static ssize_t model_show(struct device *dev, struct device_attribute *attr,
1674 char *buf)
1675{
1676 ide_drive_t *drive = to_ide_device(dev);
1677 return sprintf(buf, "%s\n", drive->id->model);
1678}
1679
1680static ssize_t firmware_show(struct device *dev, struct device_attribute *attr,
1681 char *buf)
1682{
1683 ide_drive_t *drive = to_ide_device(dev);
1684 return sprintf(buf, "%s\n", drive->id->fw_rev);
1685}
1686
1687static ssize_t serial_show(struct device *dev, struct device_attribute *attr,
1688 char *buf)
1689{
1690 ide_drive_t *drive = to_ide_device(dev);
1691 return sprintf(buf, "%s\n", drive->id->serial_no);
1692}
1693
1673static struct device_attribute ide_dev_attrs[] = { 1694static struct device_attribute ide_dev_attrs[] = {
1674 __ATTR_RO(media), 1695 __ATTR_RO(media),
1675 __ATTR_RO(drivename), 1696 __ATTR_RO(drivename),
1676 __ATTR_RO(modalias), 1697 __ATTR_RO(modalias),
1698 __ATTR_RO(model),
1699 __ATTR_RO(firmware),
1700 __ATTR(serial, 0400, serial_show, NULL),
1677 __ATTR_NULL 1701 __ATTR_NULL
1678}; 1702};
1679 1703