mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
platform/x86: silicom-platform: clean up a check
The error message in this code can't be reached because value is either zero or non-zero. There isn't a third option. Really, it's nicer to write this as a one liner. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/a58bffb7-0a8b-4195-b273-f65a188ace7b@moroto.mountain Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
214509e5d6
commit
890a48ca7b
@ -256,12 +256,7 @@ static void silicom_gpio_set(struct gpio_chip *gc,
|
||||
if (direction == GPIO_LINE_DIRECTION_IN)
|
||||
return;
|
||||
|
||||
if (value)
|
||||
silicom_mec_port_set(channel, 0);
|
||||
else if (value == 0)
|
||||
silicom_mec_port_set(channel, 1);
|
||||
else
|
||||
pr_err("Wrong argument value: %d\n", value);
|
||||
silicom_mec_port_set(channel, !value);
|
||||
}
|
||||
|
||||
static int silicom_gpio_direction_output(struct gpio_chip *gc,
|
||||
|
Loading…
x
Reference in New Issue
Block a user