Commit e4731f9a authored by Federico Vaga's avatar Federico Vaga

sysfs: remove useless check on current buffer/trigger

The check is already done by the change functions (and the buffer one
was wrong but I didn't noticed it because we had a double check)
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 3d9cee91
......@@ -501,7 +501,6 @@ static ssize_t zobj_store_cur_trig(struct device *dev,
const char *buf, size_t count)
{
char buf_tmp[ZIO_OBJ_NAME_LEN];
struct zio_cset *cset;
int err = 0, ret;
dev_dbg(dev, "Changing trigger to: %s\n", buf);
......@@ -513,10 +512,7 @@ static ssize_t zobj_store_cur_trig(struct device *dev,
return -EINVAL;
}
cset = to_zio_cset(dev);
/* change trigger only if is different then current */
if (strcmp(buf_tmp, cset->trig->head.name))
err = zio_change_current_trigger(cset, buf_tmp);
err = zio_change_current_trigger(to_zio_cset(dev), buf_tmp);
return err ? err : count;
}
/* Print the current buffer name */
......@@ -531,7 +527,6 @@ static ssize_t zobj_store_cur_zbuf(struct device *dev,
const char *buf, size_t count)
{
char buf_tmp[ZIO_OBJ_NAME_LEN];
struct zio_cset *cset;
int err = 0, ret;
dev_dbg(dev, "Changing buffer to: %s\n", buf);
......@@ -543,10 +538,7 @@ static ssize_t zobj_store_cur_zbuf(struct device *dev,
return -EINVAL;
}
cset = to_zio_cset(dev);
/* change buffer only if is different then current */
if (strcmp(buf_tmp, cset->trig->head.name))
err = zio_change_current_buffer(cset, buf_tmp);
err = zio_change_current_buffer(to_zio_cset(dev), buf_tmp);
return err ? err : count;
}
/* Print the current enable status */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment