[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <152642119396.237094.8796686281263472736@swboyd.mtv.corp.google.com>
Date: Tue, 15 May 2018 14:53:13 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Dinh Nguyen <dinguyen@...nel.org>, linux-clk@...r.kernel.org
Cc: dinguyen@...nel.org, mturquette@...libre.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] clk: socfpga: stratix10: use platform driver APIs
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.
Powered by blists - more mailing lists