LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Dinh Nguyen <dinguyen@kernel.org>, linux-clk@vger.kernel.org
Cc: dinguyen@kernel.org, mturquette@baylibre.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] clk: socfpga: stratix10: use platform driver APIs
Date: Tue, 15 May 2018 14:53:13 -0700	[thread overview]
Message-ID: <152642119396.237094.8796686281263472736@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <1525271313-24427-1-git-send-email-dinguyen@kernel.org>

Quoting Dinh Nguyen (2018-05-02 07:28:32)
> +       struct resource *res;
>         void __iomem *base;
>  
> -       base = of_iomap(np, 0);
> -       if (!base) {
> +       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +       base = devm_ioremap_resource(dev, res);
> +       if (IS_ERR(base)) {
>                 pr_err("%s: failed to map clock registers\n", __func__);
> -               goto err;
> +               return ERR_CAST(base);
>         }
>  
> -       clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
> +       clk_data = devm_kzalloc(dev, sizeof(*clk_data), GFP_KERNEL);
>         if (!clk_data)
> -               goto err;
> +               return ERR_CAST(clk_data);

I had to make these ERR_PTR(-ENOMEM), but otherwise I applied this to
clk-next.

  parent reply	other threads:[~2018-05-15 21:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 14:28 Dinh Nguyen
2018-05-02 14:28 ` [PATCH 2/2] clk: socfpga: stratix10: suppress unbinding platform's clock driver Dinh Nguyen
2018-05-15 21:53   ` Stephen Boyd
2018-05-15 21:53 ` Stephen Boyd [this message]
2018-05-15 21:55 ` [PATCH 1/2] clk: socfpga: stratix10: use platform driver APIs Stephen Boyd

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=152642119396.237094.8796686281263472736@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --subject='Re: [PATCH 1/2] clk: socfpga: stratix10: use platform driver APIs' \
    /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).