|
@@ -210,15 +210,15 @@ static int gpiochip_find_base(int ngpio)
|
|
*/
|
|
*/
|
|
int gpiod_get_direction(struct gpio_desc *desc)
|
|
int gpiod_get_direction(struct gpio_desc *desc)
|
|
{
|
|
{
|
|
- struct gpio_chip *chip;
|
|
|
|
- unsigned offset;
|
|
|
|
- int status = -EINVAL;
|
|
|
|
|
|
+ struct gpio_chip *chip;
|
|
|
|
+ unsigned offset;
|
|
|
|
+ int status;
|
|
|
|
|
|
chip = gpiod_to_chip(desc);
|
|
chip = gpiod_to_chip(desc);
|
|
offset = gpio_chip_hwgpio(desc);
|
|
offset = gpio_chip_hwgpio(desc);
|
|
|
|
|
|
if (!chip->get_direction)
|
|
if (!chip->get_direction)
|
|
- return status;
|
|
|
|
|
|
+ return -ENOTSUPP;
|
|
|
|
|
|
status = chip->get_direction(chip, offset);
|
|
status = chip->get_direction(chip, offset);
|
|
if (status > 0) {
|
|
if (status > 0) {
|