diff options
Diffstat (limited to 'drivers/input/misc/gpio-vibra.c')
| -rw-r--r-- | drivers/input/misc/gpio-vibra.c | 22 | 
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/input/misc/gpio-vibra.c b/drivers/input/misc/gpio-vibra.c index 134a1309ba92..ad44b4d18a2a 100644 --- a/drivers/input/misc/gpio-vibra.c +++ b/drivers/input/misc/gpio-vibra.c @@ -18,7 +18,7 @@  #include <linux/input.h>  #include <linux/kernel.h>  #include <linux/module.h> -#include <linux/of_device.h> +#include <linux/of.h>  #include <linux/platform_device.h>  #include <linux/property.h>  #include <linux/regulator/consumer.h> @@ -113,22 +113,14 @@ static int gpio_vibrator_probe(struct platform_device *pdev)  		return -ENOMEM;  	vibrator->vcc = devm_regulator_get(&pdev->dev, "vcc"); -	err = PTR_ERR_OR_ZERO(vibrator->vcc); -	if (err) { -		if (err != -EPROBE_DEFER) -			dev_err(&pdev->dev, "Failed to request regulator: %d\n", -				err); -		return err; -	} +	if (IS_ERR(vibrator->vcc)) +		return dev_err_probe(&pdev->dev, PTR_ERR(vibrator->vcc), +				     "Failed to request regulator\n");  	vibrator->gpio = devm_gpiod_get(&pdev->dev, "enable", GPIOD_OUT_LOW); -	err = PTR_ERR_OR_ZERO(vibrator->gpio); -	if (err) { -		if (err != -EPROBE_DEFER) -			dev_err(&pdev->dev, "Failed to request main gpio: %d\n", -				err); -		return err; -	} +	if (IS_ERR(vibrator->gpio)) +		return dev_err_probe(&pdev->dev, PTR_ERR(vibrator->gpio), +				     "Failed to request main gpio\n");  	INIT_WORK(&vibrator->play_work, gpio_vibrator_play_work);  |