mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 13:06:59 +02:00
media: solo6x10: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
94bf84c7fe
commit
bb4954b4ab
|
|
@ -127,8 +127,8 @@ static int solo_gpiochip_get(struct gpio_chip *chip,
|
|||
return 1 & (ret >> (offset + 8));
|
||||
}
|
||||
|
||||
static void solo_gpiochip_set(struct gpio_chip *chip,
|
||||
unsigned int offset, int value)
|
||||
static int solo_gpiochip_set(struct gpio_chip *chip,
|
||||
unsigned int offset, int value)
|
||||
{
|
||||
struct solo_dev *solo_dev = gpiochip_get_data(chip);
|
||||
|
||||
|
|
@ -136,6 +136,8 @@ static void solo_gpiochip_set(struct gpio_chip *chip,
|
|||
solo_gpio_set(solo_dev, 1 << (offset + 8));
|
||||
else
|
||||
solo_gpio_clear(solo_dev, 1 << (offset + 8));
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -156,7 +158,7 @@ int solo_gpio_init(struct solo_dev *solo_dev)
|
|||
|
||||
solo_dev->gpio_dev.get_direction = solo_gpiochip_get_direction;
|
||||
solo_dev->gpio_dev.get = solo_gpiochip_get;
|
||||
solo_dev->gpio_dev.set = solo_gpiochip_set;
|
||||
solo_dev->gpio_dev.set_rv = solo_gpiochip_set;
|
||||
|
||||
ret = gpiochip_add_data(&solo_dev->gpio_dev, solo_dev);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user