|
|
@@ -35,6 +35,10 @@ static ssize_t firmware_store(struct device *dev,
|
|
|
char *p;
|
|
|
int err, len = count;
|
|
|
|
|
|
+ /* restrict sysfs operations if not allowed by remoteproc drivers */
|
|
|
+ if (rproc->deny_sysfs_ops)
|
|
|
+ return -EPERM;
|
|
|
+
|
|
|
err = mutex_lock_interruptible(&rproc->lock);
|
|
|
if (err) {
|
|
|
dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, err);
|
|
|
@@ -101,6 +105,10 @@ static ssize_t state_store(struct device *dev,
|
|
|
struct rproc *rproc = to_rproc(dev);
|
|
|
int ret = 0;
|
|
|
|
|
|
+ /* restrict sysfs operations if not allowed by remoteproc drivers */
|
|
|
+ if (rproc->deny_sysfs_ops)
|
|
|
+ return -EPERM;
|
|
|
+
|
|
|
if (sysfs_streq(buf, "start")) {
|
|
|
if (rproc->state == RPROC_RUNNING)
|
|
|
return -EBUSY;
|