mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
gpio: zynqmp-modepin: 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. Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-18-b8950f69618d@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
815c9769ba
commit
680450b358
|
|
@ -57,8 +57,8 @@ static int modepin_gpio_get_value(struct gpio_chip *chip, unsigned int pin)
|
|||
*
|
||||
* Return: None.
|
||||
*/
|
||||
static void modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
|
||||
int state)
|
||||
static int modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
|
||||
int state)
|
||||
{
|
||||
u32 bootpin_val = 0;
|
||||
int ret;
|
||||
|
|
@ -77,6 +77,8 @@ static void modepin_gpio_set_value(struct gpio_chip *chip, unsigned int pin,
|
|||
ret = zynqmp_pm_bootmode_write(bootpin_val);
|
||||
if (ret)
|
||||
pr_err("modepin: set value error %d for pin %d\n", ret, pin);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -128,7 +130,7 @@ static int modepin_gpio_probe(struct platform_device *pdev)
|
|||
chip->owner = THIS_MODULE;
|
||||
chip->parent = &pdev->dev;
|
||||
chip->get = modepin_gpio_get_value;
|
||||
chip->set = modepin_gpio_set_value;
|
||||
chip->set_rv = modepin_gpio_set_value;
|
||||
chip->direction_input = modepin_gpio_dir_in;
|
||||
chip->direction_output = modepin_gpio_dir_out;
|
||||
chip->label = dev_name(&pdev->dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user