Skip to content

Commit

Permalink
[media] rc-main: store_filter: pass errors to userland
Browse files Browse the repository at this point in the history
Propagate errors returned by drivers from the s_filter callback back to
userland when updating scancode filters. This allows userland to see
when the filter couldn't be updated, usually because it's not a valid
filter for the hardware.

Previously the filter was being updated conditionally on success of
s_filter, but the write always reported success back to userland.

Reported-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
  • Loading branch information
James Hogan authored and Mauro Carvalho Chehab committed Mar 11, 2014
1 parent f61e226 commit 7b802ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/rc/rc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ static ssize_t store_filter(struct device *device,

unlock:
mutex_unlock(&dev->lock);
return count;
return (ret < 0) ? ret : count;
}

static void rc_dev_release(struct device *device)
Expand Down

0 comments on commit 7b802ce

Please sign in to comment.