Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba3b7d82 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull m68knommu fix from Greg Ungerer:
 "This contains only a single compilation fix for ColdFire m68k targets
  that use local non-GPIOLIB support."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
  m68k: define a local gpio_request_one() function
parents 4f9a197c b2dfaa8d
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -86,4 +86,24 @@ static inline int gpio_cansleep(unsigned gpio)
	return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio);
}

static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
{
	int err;

	err = gpio_request(gpio, label);
	if (err)
		return err;

	if (flags & GPIOF_DIR_IN)
		err = gpio_direction_input(gpio);
	else
		err = gpio_direction_output(gpio,
			(flags & GPIOF_INIT_HIGH) ? 1 : 0);

	if (err)
		gpio_free(gpio);

	return err;
}

#endif