From: Fabio Estevam <festevam@gmail.com>
To: thierry.reding@gmail.com
Cc: shawn.guo@linaro.org, linux-pwm@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH] pwm: pwm-mxs: Check the return value from stmp_reset_block()
Date: Tue, 9 Jul 2013 23:25:37 -0300 [thread overview]
Message-ID: <1373423137-31612-1-git-send-email-festevam@gmail.com> (raw)
From: Fabio Estevam <fabio.estevam@freescale.com>
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>
---
drivers/pwm/pwm-mxs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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)
--
1.8.1.2
next reply other threads:[~2013-07-10 2:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-10 2:25 Fabio Estevam [this message]
2013-07-29 12:24 ` [PATCH] pwm: pwm-mxs: Check the return value from stmp_reset_block() Thierry Reding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373423137-31612-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=linux-pwm@vger.kernel.org \
--cc=shawn.guo@linaro.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).