LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Clément Péron" <peron.clem@gmail.com>
To: festevam@gmail.com
Cc: "Vladimir Zapolskiy" <vladimir_zapolskiy@mentor.com>,
	"Colin Didier" <colin.didier@devialet.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Fabio Estevam" <fabio.estevam@nxp.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Clément Peron" <clement.peron@devialet.com>
Subject: Re: [PATCH v2 4/5] clocksource: add driver for i.MX EPIT timer
Date: Tue, 29 May 2018 17:59:51 +0200	[thread overview]
Message-ID: <CAJiuCccEyrUfoKV4bh4qamn-MQntcFUdvHiLu2Y8aeQ--HdiDg@mail.gmail.com> (raw)
In-Reply-To: <CAOMZO5AMK=vn7NCiQs-Ps-q=UyBro1J_+P4rTooU7nmHK20TjQ@mail.gmail.com>

Hi Fabio,
On Tue, 29 May 2018 at 17:20, Fabio Estevam <festevam@gmail.com> wrote:

> On Tue, May 29, 2018 at 12:04 PM, Clément Péron <peron.clem@gmail.com>
wrote:

> > +static int __init epit_timer_init(struct device_node *np)
> > +{
> > +       struct epit_timer *epittm;
> > +       struct clk *clk_ipg;
> > +       int ret;
> > +
> > +       epittm = kzalloc(sizeof(*epittm), GFP_KERNEL);
> > +       if (!epittm)
> > +               return -ENOMEM;
> > +
> > +       epittm->base = of_iomap(np, 0);
> > +       if (!epittm->base) {
> > +               ret = -ENXIO;
> > +               goto out_kfree;
> > +       }
> > +
> > +       epittm->irq = irq_of_parse_and_map(np, 0);
> > +       if (!epittm->irq) {
> > +               ret = -EINVAL;
> > +               goto out_kfree;

> You should jump to out_iounmap and call of_iounmap().

> > +       }
> > +
> > +       clk_ipg = of_clk_get_by_name(np, "ipg");
> > +       if (IS_ERR(clk_ipg)) {
> > +               pr_err("i.MX EPIT: unable to get clk_ipg\n");
> > +               ret = PTR_ERR(clk_ipg);
> > +               goto out_kfree;
> > +       }
> > +       clk_prepare_enable(clk_ipg);

> clk_prepare_enable() may fail, so better check its return value and
> propagate it in the case of error.

> > +
> > +       epittm->clk_per = of_clk_get_by_name(np, "per");
> > +       if (IS_ERR(epittm->clk_per)) {
> > +               pr_err("i.MX EPIT: unable to get clk_per\n");
> > +               ret = PTR_ERR(epittm->clk_per);
> > +               goto out_clk_ipg_disable;
> > +       }
> > +       clk_prepare_enable(epittm->clk_per);

> Ditto.

> > +
> > +       /*
> > +        * Initialise to a known state (all timers off, and timing
reset)
> > +        */

> For a single line of comment you could simply write:

> /* bla bla */

Thanks for the review, i will send a new version

Clement

  reply	other threads:[~2018-05-29 16:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 15:04 [PATCH v2 0/5] Reintroduce i.MX EPIT Timer Clément Péron
2018-05-29 15:04 ` [PATCH v2 1/5] ARM: imx: remove inexistant EPIT timer init Clément Péron
2018-05-29 15:21   ` Fabio Estevam
2018-05-29 15:04 ` [PATCH v2 2/5] ARM: clk-imx6q: add EPIT clock support Clément Péron
2018-05-29 15:23   ` Fabio Estevam
2018-05-29 15:04 ` [PATCH v2 3/5] Documentation: DT: add i.MX EPIT timer binding Clément Péron
2018-05-29 15:15   ` Fabio Estevam
2018-05-29 16:38   ` Rob Herring
2018-05-29 15:04 ` [PATCH v2 4/5] clocksource: add driver for i.MX EPIT timer Clément Péron
2018-05-29 15:20   ` Fabio Estevam
2018-05-29 15:59     ` Clément Péron [this message]
2018-05-29 15:04 ` [PATCH v2 5/5] ARM: dts: imx6qdl: add missing compatible and clock properties for EPIT Clément Péron
2018-05-29 15:24   ` Fabio Estevam

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=CAJiuCccEyrUfoKV4bh4qamn-MQntcFUdvHiLu2Y8aeQ--HdiDg@mail.gmail.com \
    --to=peron.clem@gmail.com \
    --cc=clement.peron@devialet.com \
    --cc=colin.didier@devialet.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=fabio.estevam@nxp.com \
    --cc=festevam@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=tglx@linutronix.de \
    --cc=vladimir_zapolskiy@mentor.com \
    --subject='Re: [PATCH v2 4/5] clocksource: add driver for i.MX EPIT timer' \
    /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

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).