summaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-07-09 23:25:37 -0300
committerThierry Reding <thierry.reding@gmail.com>2013-09-03 13:07:51 +0200
commitcfb9e4c40e87dffdce96d3a95c33d01f441b2470 (patch)
treeee66cf7481b49aa44e7757c930a628c76e24f0ea /drivers/pwm
parent9da01759636f519967c0922ae12bd9fff739db9a (diff)
downloadop-kernel-dev-cfb9e4c40e87dffdce96d3a95c33d01f441b2470.zip
op-kernel-dev-cfb9e4c40e87dffdce96d3a95c33d01f441b2470.tar.gz
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 <fabio.estevam@freescale.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-mxs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
index 2c77b81..c2c5a4f 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)
OpenPOWER on IntegriCloud