]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/remoteproc/remoteproc_sysfs.c
remoteproc: stm32: fix probe error case
[linux.git] / drivers / remoteproc / remoteproc_sysfs.c
index fa413193010661ed744ddeb0ef3bf73e5b58865f..7f8536b73295d50d85dae7203e7fea8443a6941b 100644 (file)
@@ -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
 };