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