Messages in this thread | | | Subject | Re: [PATCH v2] Input: add regulator haptic driver | From | Oliver Neukum <> | Date | Thu, 24 Oct 2013 10:38:06 +0200 |
| |
On Thu, 2013-10-24 at 15:35 +0900, hyunhee.kim wrote:
Hi,
first of all your mail client mangled the patch.
> +static void regulator_haptic_toggle(struct regulator_haptic *haptic, bool > enable) > +{ > + int ret; > + > + mutex_lock(&haptic->mutex); > + if (enable && !haptic->enabled) { > + haptic->enabled = true; > + ret = regulator_enable(haptic->regulator); > + if (ret) > + dev_err(haptic->dev, "failed to enable > regulator\n"); > + } else if (!enable && haptic->enabled) { > + haptic->enabled = false; > + ret = regulator_disable(haptic->regulator); > + if (ret) > + dev_err(haptic->dev, "failed to disable > regulator\n"); > + } > + mutex_unlock(&haptic->mutex); > +} > +
Is there anything gained by the toggle parameter? Just code two functions.
Regards Oliver
| |