Re: [PATCH 1/2] gpio: wm831x: use the new open drain callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 10, 2016 at 03:12:19PM +0200, Linus Walleij wrote:

> +	int reg = WM831X_GPIO1_CONTROL + offset;
> +
> +	if (mode == LINE_MODE_OPEN_DRAIN)
> +		return wm831x_set_bits(wm831x, reg,
> +				       WM831X_GPN_OD_MASK, WM831X_GPN_OD);
> +
> +	if (mode == LINE_MODE_PUSH_PULL)
> +		return wm831x_set_bits(wm831x, reg,
> +				       WM831X_GPN_OD_MASK, 0);
> +
> +	return -ENOTSUPP;

This looks like it'd be better written as a switch statement (it's more
natural and less error prone).

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux