From: Josh Cartwright <joshc@codeaurora.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@iguana.be>,
linux-watchdog@vger.kernel.org,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Kumar Gala <galak@codeaurora.org>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/3] watchdog: qcom: add support for KPSS WDT
Date: Thu, 25 Sep 2014 14:00:54 -0500 [thread overview]
Message-ID: <20140925190054.GJ868@joshc.qualcomm.com> (raw)
In-Reply-To: <20140925183857.GA12340@roeck-us.net>
On Thu, Sep 25, 2014 at 11:38:57AM -0700, Guenter Roeck wrote:
> On Thu, Sep 25, 2014 at 12:48:51PM -0500, Josh Cartwright wrote:
> > Add a driver for the watchdog timer block found in the Krait Processor
> > Subsystem (KPSS) on the MSM8960, APQ8064, and IPQ8064.
> >
> > Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
>
> Hi Josh,
>
> just a couple of minor comments this time (yes, I know,
> I am being difficult ;-).
Difficult, maybe, but at least someone's taking a look! Thanks, again.
[..]
> > +++ b/drivers/watchdog/qcom-wdt.c
[..]
> > +static int qcom_wdt_probe(struct platform_device *pdev)
> > +{
> > + struct qcom_wdt *wdt;
> > + struct resource *res;
> > + int ret;
> > +
> > + wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
> > + if (!wdt)
> > + return -ENOMEM;
> > +
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > + wdt->base = devm_ioremap_resource(&pdev->dev, res);
> > + if (IS_ERR(wdt->base)) {
> > + ret = PTR_ERR(wdt->base);
> > + goto err_out;
>
> This is really unnecessary. Just return PTR_ERR((wdt->base) as you did before.
> No need to make the code more complicated than necessary.
>
> Basic rule is: If you can return immediately, do it. Otherwise use goto
> and have a single error handler.
>
> > + }
> > +
> > + wdt->clk = devm_clk_get(&pdev->dev, NULL);
> > + if (IS_ERR(wdt->clk)) {
> > + ret = PTR_ERR(wdt->clk);
> > + goto err_out;
>
> Same here.
>
> > + }
> > +
> > + ret = clk_prepare_enable(wdt->clk);
> > + if (ret) {
> > + dev_err(&pdev->dev, "failed to setup clock\n");
> > + goto err_out;
>
> and here.
Okay, I can fix these up.
Josh
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2014-09-25 19:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1411667144.git.joshc@codeaurora.org>
2014-09-25 17:48 ` [PATCH v3 1/3] watchdog: qcom: add support for KPSS WDT Josh Cartwright
2014-09-25 18:38 ` Guenter Roeck
2014-09-25 19:00 ` Josh Cartwright [this message]
2014-09-25 17:48 ` [PATCH v3 2/3] watchdog: qcom: document device tree bindings Josh Cartwright
2014-09-25 18:43 ` Guenter Roeck
2014-09-25 19:01 ` Josh Cartwright
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=20140925190054.GJ868@joshc.qualcomm.com \
--to=joshc@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
--cc=wim@iguana.be \
/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).