[PATCH] clk: mediatek: reset: Remove unused mtk_register_reset_controller()

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Tue Jul 23 08:09:40 PDT 2024


Il 18/07/24 11:41, Fei Shao ha scritto:
> On Thu, Jul 18, 2024 at 4:26 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno at collabora.com> wrote:
>>
>> Now that all clock controllers have been migrated to the new
>> mtk_register_reset_controller_with_dev() function, the one taking
>> struct device node is now unused: remove it.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
>> ---
>>   drivers/clk/mediatek/reset.c | 59 ------------------------------------
>>   drivers/clk/mediatek/reset.h | 10 ------
>>   2 files changed, 69 deletions(-)
>>
>> diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c
>> index 290ceda84ce4..069f9e909cb0 100644
>> --- a/drivers/clk/mediatek/reset.c
>> +++ b/drivers/clk/mediatek/reset.c
>> @@ -110,65 +110,6 @@ static int reset_xlate(struct reset_controller_dev *rcdev,
>>          return data->desc->rst_idx_map[reset_spec->args[0]];
>>   }
>>
>> -int mtk_register_reset_controller(struct device_node *np,
>> -                                 const struct mtk_clk_rst_desc *desc)
>> -{
>> -       struct regmap *regmap;
>> -       const struct reset_control_ops *rcops = NULL;
>> -       struct mtk_clk_rst_data *data;
>> -       int ret;
>> -
>> -       if (!desc) {
>> -               pr_err("mtk clock reset desc is NULL\n");
>> -               return -EINVAL;
>> -       }
>> -
>> -       switch (desc->version) {
>> -       case MTK_RST_SIMPLE:
>> -               rcops = &mtk_reset_ops;
>> -               break;
>> -       case MTK_RST_SET_CLR:
>> -               rcops = &mtk_reset_ops_set_clr;
>> -               break;
>> -       default:
>> -               pr_err("Unknown reset version %d\n", desc->version);
>> -               return -EINVAL;
>> -       }
>> -
>> -       regmap = device_node_to_regmap(np);
>> -       if (IS_ERR(regmap)) {
>> -               pr_err("Cannot find regmap for %pOF: %pe\n", np, regmap);
>> -               return -EINVAL;
>> -       }
>> -
>> -       data = kzalloc(sizeof(*data), GFP_KERNEL);
>> -       if (!data)
>> -               return -ENOMEM;
>> -
>> -       data->desc = desc;
>> -       data->regmap = regmap;
>> -       data->rcdev.owner = THIS_MODULE;
>> -       data->rcdev.ops = rcops;
>> -       data->rcdev.of_node = np;
>> -
>> -       if (data->desc->rst_idx_map_nr > 0) {
>> -               data->rcdev.of_reset_n_cells = 1;
>> -               data->rcdev.nr_resets = desc->rst_idx_map_nr;
>> -               data->rcdev.of_xlate = reset_xlate;
>> -       } else {
>> -               data->rcdev.nr_resets = desc->rst_bank_nr * RST_NR_PER_BANK;
>> -       }
>> -
>> -       ret = reset_controller_register(&data->rcdev);
>> -       if (ret) {
>> -               pr_err("could not register reset controller: %d\n", ret);
>> -               kfree(data);
>> -               return ret;
>> -       }
>> -
>> -       return 0;
>> -}
>> -
>>   int mtk_register_reset_controller_with_dev(struct device *dev,
>>                                             const struct mtk_clk_rst_desc *desc)
> 
> I guess that means the "_with_dev" suffix here becomes redundant and
> therefore can be removed.
> Do you want to update it all together?
> 

Makes sense to add another commit that performs the rename... yeah.

Cheers,
Angelo

> Regards,
> Fei
> 
> 
>>   {
>> diff --git a/drivers/clk/mediatek/reset.h b/drivers/clk/mediatek/reset.h
>> index 6a58a3d59165..562ffd290a22 100644
>> --- a/drivers/clk/mediatek/reset.h
>> +++ b/drivers/clk/mediatek/reset.h
>> @@ -59,16 +59,6 @@ struct mtk_clk_rst_data {
>>          const struct mtk_clk_rst_desc *desc;
>>   };
>>
>> -/**
>> - * mtk_register_reset_controller - Register MediaTek clock reset controller
>> - * @np: Pointer to device node.
>> - * @desc: Constant pointer to description of clock reset.
>> - *
>> - * Return: 0 on success and errorno otherwise.
>> - */
>> -int mtk_register_reset_controller(struct device_node *np,
>> -                                 const struct mtk_clk_rst_desc *desc);
>> -
>>   /**
>>    * mtk_register_reset_controller - Register mediatek clock reset controller with device
>>    * @np: Pointer to device.
>> --
>> 2.45.2
>>
>>





More information about the Linux-mediatek mailing list