summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/remoteproc_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/remoteproc/remoteproc_sysfs.c')
-rw-r--r--drivers/remoteproc/remoteproc_sysfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c
index fa4131930106..7f8536b73295 100644
--- a/drivers/remoteproc/remoteproc_sysfs.c
+++ b/drivers/remoteproc/remoteproc_sysfs.c
@@ -113,9 +113,20 @@ static ssize_t state_store(struct device *dev,
}
static DEVICE_ATTR_RW(state);
+/* Expose the name of the remote processor via sysfs */
+static ssize_t name_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct rproc *rproc = to_rproc(dev);
+
+ return sprintf(buf, "%s\n", rproc->name);
+}
+static DEVICE_ATTR_RO(name);
+
static struct attribute *rproc_attrs[] = {
&dev_attr_firmware.attr,
&dev_attr_state.attr,
+ &dev_attr_name.attr,
NULL
};