ideapad: Only allow camera state to be set to 0 or 1
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
ce326329d7
commit
2016e4a0a1
@ -140,7 +140,7 @@ static ssize_t store_ideapad_cam(struct device *dev,
|
|||||||
return 0;
|
return 0;
|
||||||
if (sscanf(buf, "%i", &state) != 1)
|
if (sscanf(buf, "%i", &state) != 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
ret = ideapad_dev_set_state(IDEAPAD_DEV_CAMERA, state);
|
ret = ideapad_dev_set_state(IDEAPAD_DEV_CAMERA, !!state);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user