summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 23:31:58 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 23:31:58 +0100
commite11b9035a47da66fcd4bafd3a5f6b14f51ca667e (patch)
tree060ba965247b2c3f31ec2873a9669cadb31d9ac8 /drivers/ide/ide.c
parent1b7d3477a7b0d52406d68b01bc8931f43112677f (diff)
downloadlinux-e11b9035a47da66fcd4bafd3a5f6b14f51ca667e.tar.gz
linux-e11b9035a47da66fcd4bafd3a5f6b14f51ca667e.tar.bz2
linux-e11b9035a47da66fcd4bafd3a5f6b14f51ca667e.zip
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>
Diffstat (limited to 'drivers/ide/ide.c')
-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,
return sprintf(buf, "ide:m-%s\n", media_string(drive));
}
+static ssize_t model_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ return sprintf(buf, "%s\n", drive->id->model);
+}
+
+static ssize_t firmware_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ return sprintf(buf, "%s\n", drive->id->fw_rev);
+}
+
+static ssize_t serial_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ return sprintf(buf, "%s\n", drive->id->serial_no);
+}
+
static struct device_attribute ide_dev_attrs[] = {
__ATTR_RO(media),
__ATTR_RO(drivename),
__ATTR_RO(modalias),
+ __ATTR_RO(model),
+ __ATTR_RO(firmware),
+ __ATTR(serial, 0400, serial_show, NULL),
__ATTR_NULL
};