diff options
author | Dan Williams <dan.j.williams@intel.com> | 2014-12-30 17:46:16 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2015-01-09 09:44:18 -0500 |
commit | 967f7bab0eaaa74d7d01a56d45aa309f78fb87dd (patch) | |
tree | c060248c671d1d2882458941d5de40a1dc7441cd /drivers/misc | |
parent | 15a0fbbc8e0d4c135b069c34258fbaebad471dd7 (diff) |
ses: add enclosure logical id
Export the NAA logical id for the enclosure. This is optionally
available from the sas_transport_class, but it is really a property of
the enclosure.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Reviewed-by: Jens Axboe <axboe@fb.com>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/enclosure.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index e18278aa6bbb..958ee988a1e1 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c | |||
@@ -432,8 +432,21 @@ static ssize_t components_show(struct device *cdev, | |||
432 | } | 432 | } |
433 | static DEVICE_ATTR_RO(components); | 433 | static DEVICE_ATTR_RO(components); |
434 | 434 | ||
435 | static ssize_t id_show(struct device *cdev, | ||
436 | struct device_attribute *attr, | ||
437 | char *buf) | ||
438 | { | ||
439 | struct enclosure_device *edev = to_enclosure_device(cdev); | ||
440 | |||
441 | if (edev->cb->show_id) | ||
442 | return edev->cb->show_id(edev, buf); | ||
443 | return -EINVAL; | ||
444 | } | ||
445 | static DEVICE_ATTR_RO(id); | ||
446 | |||
435 | static struct attribute *enclosure_class_attrs[] = { | 447 | static struct attribute *enclosure_class_attrs[] = { |
436 | &dev_attr_components.attr, | 448 | &dev_attr_components.attr, |
449 | &dev_attr_id.attr, | ||
437 | NULL, | 450 | NULL, |
438 | }; | 451 | }; |
439 | ATTRIBUTE_GROUPS(enclosure_class); | 452 | ATTRIBUTE_GROUPS(enclosure_class); |