input: max77693-haptic: Make use of the helper function dev_err_probe()
Subsystems (2)
PATCH 1/1 input: max77693-haptic: Make use of the helper function dev_err_probe()
devm_pwm_get() can return -EPROBE_DEFER if the pwm regulator is not ready yet. Use dev_err_probe() for pwm regulator resources to indicate the deferral reason when waiting for the resource to come up.
Signed-off-by zhaoxiao <[email protected]>
--- drivers/input/misc/max77693-haptic.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/input/misc/max77693-haptic.c +3 -5
@@ -325,11 +325,9 @@ static int max77693_haptic_probe(struct platform_device *pdev)/* Get pwm and regulatot for haptic device */ haptic->pwm_dev =devm_pwm_get (&pdev->dev,NULL ); -if (IS_ERR (haptic->pwm_dev)) { -dev_err (&pdev->dev,"failed to get pwm device\n" ); -return PTR_ERR (haptic->pwm_dev); - } - +if (IS_ERR (haptic->pwm_dev)) +return dev_err_probe (&pdev->dev,PTR_ERR (haptic->pwm_dev), +"failed to get pwm device\n" );/* * FIXME: pwm_apply_args() should be removed when switching to the * atomic PWM API.
Signature · 1 line
2.20.1