lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0e278e57-139b-4074-ab3a-d35cef79e7f8@collabora.com>
Date: Tue, 23 Jul 2024 17:09:40 +0200
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: Fei Shao <fshao@...omium.org>
Cc: sboyd@...nel.org, matthias.bgg@...il.com, mturquette@...libre.com,
 p.zabel@...gutronix.de, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
 linux-clk@...r.kernel.org, kernel@...labora.com
Subject: Re: [PATCH] clk: mediatek: reset: Remove unused
 mtk_register_reset_controller()

Il 18/07/24 11:41, Fei Shao ha scritto:
> On Thu, Jul 18, 2024 at 4:26 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@...labora.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@...labora.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
>>
>>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ