diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-06-07 23:24:07 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-06-07 23:24:07 -0700 |
| commit | a292241cccb7e20e8b997a9a44177e7c98141859 (patch) | |
| tree | a0b0bb95e7dce3233a2d8b203f9e326cdec7a00e /drivers/input/misc/max8997_haptic.c | |
| parent | d49cb7aeebb974713f9f7ab2991352d3050b095b (diff) | |
| parent | 68807a0c2015cb40df4869e16651f0ce5cc14d52 (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 3.16.
Diffstat (limited to 'drivers/input/misc/max8997_haptic.c')
| -rw-r--r-- | drivers/input/misc/max8997_haptic.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c index 1fea5484941f..a363ebbd9cc0 100644 --- a/drivers/input/misc/max8997_haptic.c +++ b/drivers/input/misc/max8997_haptic.c @@ -181,11 +181,21 @@ static void max8997_haptic_enable(struct max8997_haptic *chip) } if (!chip->enabled) { - chip->enabled = true; - regulator_enable(chip->regulator); + error = regulator_enable(chip->regulator); + if (error) { + dev_err(chip->dev, "Failed to enable regulator\n"); + goto out; + } max8997_haptic_configure(chip); - if (chip->mode == MAX8997_EXTERNAL_MODE) - pwm_enable(chip->pwm); + if (chip->mode == MAX8997_EXTERNAL_MODE) { + error = pwm_enable(chip->pwm); + if (error) { + dev_err(chip->dev, "Failed to enable PWM\n"); + regulator_disable(chip->regulator); + goto out; + } + } + chip->enabled = true; } out: |
