bcm2835_gpio_direction_output not setting up GPIO value

Martin Sperl kernel at martin.sperl.org
Mon Apr 6 02:10:58 PDT 2015


Is there any reason why bcm2835_gpio_direction_output is
not setting up the value of GPIO as requested?

static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
					 unsigned offset, int value)
{
	return pinctrl_gpio_direction_output(chip->base + offset);
}
Some oversight?

Maybe it should look like this (untested)?

static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
					 unsigned offset, int value)
{
	int err = pinctrl_gpio_direction_output(chip->base + offset);
	if (!err)
		bcm2835_gpio_set(chip, offset, value);
	return err;
}




More information about the linux-rpi-kernel mailing list