diff options
Diffstat (limited to 'drivers/base/soc.c')
-rw-r--r-- | drivers/base/soc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/base/soc.c b/drivers/base/soc.c index b63f23e6ad61..1c06cc731c7f 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -33,6 +33,7 @@ static struct bus_type soc_bus_type = { static DEVICE_ATTR(machine, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(family, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(soc_id, S_IRUGO, soc_info_get, NULL); +static DEVICE_ATTR(unique_id, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(revision, S_IRUGO, soc_info_get, NULL); struct device *soc_device_to_device(struct soc_device *soc_dev) @@ -59,6 +60,9 @@ static umode_t soc_attribute_mode(struct kobject *kobj, if ((attr == &dev_attr_soc_id.attr) && (soc_dev->attr->soc_id != NULL)) return attr->mode; + if ((attr == &dev_attr_unique_id.attr) + && (soc_dev->attr->unique_id != NULL)) + return attr->mode; /* Unknown or unfilled attribute. */ return 0; @@ -78,6 +82,8 @@ static ssize_t soc_info_get(struct device *dev, return sprintf(buf, "%s\n", soc_dev->attr->revision); if (attr == &dev_attr_soc_id) return sprintf(buf, "%s\n", soc_dev->attr->soc_id); + if (attr == &dev_attr_unique_id) + return sprintf(buf, "%s\n", soc_dev->attr->unique_id); return -EINVAL; @@ -87,6 +93,7 @@ static struct attribute *soc_attr[] = { &dev_attr_machine.attr, &dev_attr_family.attr, &dev_attr_soc_id.attr, + &dev_attr_unique_id.attr, &dev_attr_revision.attr, NULL, }; |