From: Fabio Estevam Date: Wed, 10 Jul 2013 02:25:37 +0000 (-0300) Subject: pwm: mxs: Check the return value from stmp_reset_block() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=cfb9e4c40e87dffdce96d3a95c33d01f441b2470;p=openwrt%2Fstaging%2Fblogic.git pwm: mxs: Check the return value from stmp_reset_block() stmp_reset_block() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam Signed-off-by: Thierry Reding --- diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c index 2c77b81da7c4..c2c5a4fd1b96 100644 --- a/drivers/pwm/pwm-mxs.c +++ b/drivers/pwm/pwm-mxs.c @@ -161,9 +161,15 @@ static int mxs_pwm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mxs); - stmp_reset_block(mxs->base); + ret = stmp_reset_block(mxs->base); + if (ret) + goto pwm_remove; return 0; + +pwm_remove: + pwmchip_remove(&mxs->chip); + return ret; } static int mxs_pwm_remove(struct platform_device *pdev)