Re: [PATCH v6 2/3] clk: mediatek: Add auxiliary bus support for sysclk reset
From: Stephen Boyd
Date: Thu Oct 27 2022 - 19:46:30 EST
Quoting Bo-Chen Chen (2022-10-21 03:48:03)
> diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
> index 74408849ed86..61b7ee23738a 100644
> --- a/drivers/clk/mediatek/clk-mtk.c
> +++ b/drivers/clk/mediatek/clk-mtk.c
> @@ -444,6 +444,63 @@ void mtk_clk_unregister_dividers(const struct mtk_clk_divider *mcds, int num,
[..]
> +int mtk_reset_controller_register(struct device *dev, const char *name)
> +{
> + struct auxiliary_device *adev;
> + int ret;
> +
> + adev = mtk_reset_adev_alloc(dev, name);
> + if (IS_ERR(adev))
> + return PTR_ERR(adev);
> +
> + ret = auxiliary_device_add(adev);
> + if (ret) {
> + auxiliary_device_uninit(adev);
> + return ret;
> + }
> +
> + return devm_add_action_or_reset(dev, mtk_reset_unregister_adev, adev);
Can we have devm_auxiliary_device_add() that sets the parent and
registers the device?