From: <Conor.Dooley@microchip.com>
To: <Claudiu.Beznea@microchip.com>, <mturquette@baylibre.com>,
<sboyd@kernel.org>, <robh+dt@kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>, <palmer@dabbelt.com>,
<p.zabel@pengutronix.de>, <Daire.McNamara@microchip.com>
Cc: <paul.walmsley@sifive.com>, <aou@eecs.berkeley.edu>,
<linux-clk@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v3 03/13] clk: microchip: mpfs: add reset controller
Date: Tue, 30 Aug 2022 06:44:57 +0000 [thread overview]
Message-ID: <ed1d4fb5-c9e9-39de-d21a-4156991e9e37@microchip.com> (raw)
In-Reply-To: <8726cec3-858a-b0c2-ab26-c1e2d2702776@microchip.com>
On 30/08/2022 07:40, Claudiu Beznea - M18063 wrote:
> On 19.08.2022 12:53, Conor Dooley wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> Add a reset controller to PolarFire SoC's clock driver. This reset
>> controller is registered as an aux device and read/write functions
>> exported to the drivers namespace so that the reset controller can
>> access the peripheral device reset register.
>>
>> Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>
>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>> ---
>> +static int mpfs_reset_controller_register(struct mpfs_clock_data *clk_data)
>> +{
>> + struct auxiliary_device *adev;
>> + int ret;
>> +
>> + adev = mpfs_reset_adev_alloc(clk_data);
>> + if (IS_ERR(adev))
>> + return PTR_ERR(adev);
>> +
>> + ret = auxiliary_device_add(adev);
>> + if (ret) {
>> + auxiliary_device_uninit(adev);
>> + return ret;
>> + }
>> +
>> + ret = devm_add_action_or_reset(clk_data->dev, mpfs_reset_unregister_adev, adev);
>> + if (ret)
>> + return ret;
>> +
>> + return 0;
>
> You can just:
> return ret;
> or:
> return devm_add_action_or_reset();
>
>> +}
>> +
>> +#else /* !CONFIG_RESET_CONTROLLER */
>> +
>> +static int mpfs_reset_controller_register(struct mpfs_clock_data *clk_data)
>> +{
>> + return 0;
>> +}
>> +
>> +#endif /* !CONFIG_RESET_CONTROLLER */
>> +
>> static int mpfs_clk_probe(struct platform_device *pdev)
>> {
>> struct device *dev = &pdev->dev;
>> @@ -465,6 +553,8 @@ static int mpfs_clk_probe(struct platform_device *pdev)
>> return PTR_ERR(clk_data->msspll_base);
>>
>> clk_data->hw_data.num = num_clks;
>> + clk_data->dev = dev;
>> + dev_set_drvdata(dev, clk_data);
>>
>> ret = mpfs_clk_register_mssplls(dev, mpfs_msspll_clks, ARRAY_SIZE(mpfs_msspll_clks),
>> clk_data);
>> @@ -484,6 +574,10 @@ static int mpfs_clk_probe(struct platform_device *pdev)
>> if (ret)
>> return ret;
>>
>> + ret = mpfs_reset_controller_register(clk_data);
>> + if (ret)
>> + return ret;
>> +
>> return ret;
>
> Ditto
>
>> }
>>
willdo^2
Thanks,
Conor.
next prev parent reply other threads:[~2022-08-30 6:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 9:53 [PATCH v3 00/13] PolarFire SoC reset controller & clock cleanups Conor Dooley
2022-08-19 9:53 ` [PATCH v3 01/13] clk: microchip: mpfs: fix clk_cfg array bounds violation Conor Dooley
2022-08-19 9:53 ` [PATCH v3 02/13] dt-bindings: clk: microchip: mpfs: add reset controller support Conor Dooley
2022-08-19 9:53 ` [PATCH v3 03/13] clk: microchip: mpfs: add reset controller Conor Dooley
2022-08-30 6:40 ` Claudiu.Beznea
2022-08-30 6:44 ` Conor.Dooley [this message]
2022-08-19 9:53 ` [PATCH v3 04/13] reset: add polarfire soc reset support Conor Dooley
2022-08-19 9:53 ` [PATCH v3 05/13] MAINTAINERS: add polarfire soc reset controller Conor Dooley
2022-08-19 9:53 ` [PATCH v3 06/13] riscv: dts: microchip: add mpfs specific macb reset support Conor Dooley
2022-08-19 9:53 ` [PATCH v3 07/13] clk: microchip: mpfs: add MSS pll's set & round rate Conor Dooley
2022-08-19 9:53 ` [PATCH v3 08/13] clk: microchip: mpfs: move id & offset out of clock structs Conor Dooley
2022-08-19 9:53 ` [PATCH v3 09/13] clk: microchip: mpfs: simplify control reg access Conor Dooley
2022-08-19 9:53 ` [PATCH v3 10/13] clk: microchip: mpfs: delete 2 line mpfs_clk_register_foo() Conor Dooley
2022-08-19 9:53 ` [PATCH v3 11/13] clk: microchip: mpfs: convert cfg_clk to clk_divider Conor Dooley
2022-08-19 9:53 ` [PATCH v3 12/13] clk: microchip: mpfs: convert periph_clk to clk_gate Conor Dooley
2022-08-19 9:53 ` [PATCH v3 13/13] clk: microchip: mpfs: update module authorship & licencing Conor Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ed1d4fb5-c9e9-39de-d21a-4156991e9e37@microchip.com \
--to=conor.dooley@microchip.com \
--cc=Claudiu.Beznea@microchip.com \
--cc=Daire.McNamara@microchip.com \
--cc=aou@eecs.berkeley.edu \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).