mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
media: dvb-frontends/cxd2820r: 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:
committed by
Hans Verkuil
parent
ce5cac69b2
commit
13518ae320
@@ -433,7 +433,7 @@ static int cxd2820r_gpio_direction_output(struct gpio_chip *chip, unsigned nr,
|
||||
return cxd2820r_gpio(&priv->fe, gpio);
|
||||
}
|
||||
|
||||
static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val)
|
||||
static int cxd2820r_gpio_set(struct gpio_chip *chip, unsigned int nr, int val)
|
||||
{
|
||||
struct cxd2820r_priv *priv = gpiochip_get_data(chip);
|
||||
struct i2c_client *client = priv->client[0];
|
||||
@@ -446,7 +446,7 @@ static void cxd2820r_gpio_set(struct gpio_chip *chip, unsigned nr, int val)
|
||||
|
||||
(void) cxd2820r_gpio(&priv->fe, gpio);
|
||||
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cxd2820r_gpio_get(struct gpio_chip *chip, unsigned nr)
|
||||
@@ -651,7 +651,7 @@ static int cxd2820r_probe(struct i2c_client *client)
|
||||
priv->gpio_chip.parent = &client->dev;
|
||||
priv->gpio_chip.owner = THIS_MODULE;
|
||||
priv->gpio_chip.direction_output = cxd2820r_gpio_direction_output;
|
||||
priv->gpio_chip.set = cxd2820r_gpio_set;
|
||||
priv->gpio_chip.set_rv = cxd2820r_gpio_set;
|
||||
priv->gpio_chip.get = cxd2820r_gpio_get;
|
||||
priv->gpio_chip.base = -1; /* Dynamic allocation */
|
||||
priv->gpio_chip.ngpio = GPIO_COUNT;
|
||||
|
||||
Reference in New Issue
Block a user