lkml.org 
[lkml]   [2022]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v2 03/11] clk: mediatek: Convert mtk_{alloc,free}_clk_data to struct clk_hw
    Date
    >-struct clk_onecell_data *mtk_alloc_clk_data(unsigned int clk_num)
    >+struct clk_hw_onecell_data *mtk_alloc_clk_data(unsigned int clk_num)
    > {
    > int i;
    > struct clk_onecell_data *clk_data;

    This struct clk_onecell_data also be struct clk_hw_onecell_data?
    >
    >- clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
    >+ clk_data = kzalloc(struct_size(clk_data, hws, clk_num), GFP_KERNEL);
    > if (!clk_data)
    > return NULL;
    >
    >- clk_data->clks = kcalloc(clk_num, sizeof(*clk_data->clks), GFP_KERNEL);
    >- if (!clk_data->clks)
    >- goto err_out;
    >-
    >- clk_data->clk_num = clk_num;
    >+ clk_data->num = clk_num;
    >
    > for (i = 0; i < clk_num; i++)
    >- clk_data->clks[i] = ERR_PTR(-ENOENT);
    >+ clk_data->hws[i] = ERR_PTR(-ENOENT);
    >
    > return clk_data;
    >-err_out:
    >- kfree(clk_data);
    >-
    >- return NULL;
    > }
    > EXPORT_SYMBOL_GPL(mtk_alloc_clk_data);
    >
    >-void mtk_free_clk_data(struct clk_onecell_data *clk_data)
    >+void mtk_free_clk_data(struct clk_hw_onecell_data *clk_data)
    > {
    >- if (!clk_data)
    >- return;
    >-
    >- kfree(clk_data->clks);
    > kfree(clk_data);
    > }
    >+EXPORT_SYMBOL_GPL(mtk_free_clk_data);


    \
     
     \ /
      Last update: 2022-05-12 16:06    [W:3.056 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site