提交 e11b9035 编写于 作者: B Bartlomiej Zolnierkiewicz

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: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 1b7d3477
...@@ -1670,10 +1670,34 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, ...@@ -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)); 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[] = { static struct device_attribute ide_dev_attrs[] = {
__ATTR_RO(media), __ATTR_RO(media),
__ATTR_RO(drivename), __ATTR_RO(drivename),
__ATTR_RO(modalias), __ATTR_RO(modalias),
__ATTR_RO(model),
__ATTR_RO(firmware),
__ATTR(serial, 0400, serial_show, NULL),
__ATTR_NULL __ATTR_NULL
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册