lkml.org 
[lkml]   [2018]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] clk: socfpga: stratix10: use platform driver APIs
Date
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.

\
 
 \ /
  Last update: 2018-05-15 23:53    [W:0.066 / U:1.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site