[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXv+5Eq=VDfM35u0bxAS_-Dxv9yUpNAFqar_nCyC=5tXbtMFw@mail.gmail.com>
Date: Fri, 30 Dec 2022 16:12:44 +0800
From: Chen-Yu Tsai <wenst@...omium.org>
To: Miles Chen <miles.chen@...iatek.com>
Cc: angelogioacchino.delregno@...labora.com,
chun-jie.chen@...iatek.com, daniel@...rotopia.org,
devicetree@...r.kernel.org, fparent@...libre.com,
ikjn@...omium.org, johnson.wang@...iatek.com,
jose.exposito89@...il.com, kernel@...labora.com,
krzysztof.kozlowski+dt@...aro.org,
linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
matthias.bgg@...il.com, msp@...libre.com, mturquette@...libre.com,
nfraprado@...labora.com, pablo.sun@...iatek.com,
rex-bc.chen@...iatek.com, robh+dt@...nel.org, ryder.lee@...nel.org,
sam.shih@...iatek.com, sboyd@...nel.org, weiyi.lu@...iatek.com,
y.oudjana@...tonmail.com, yangyingliang@...wei.com
Subject: Re: [PATCH v2 18/23] clk: mediatek: clk-mtk: Register MFG notifier in mtk_clk_simple_probe()
On Thu, Dec 29, 2022 at 4:21 PM Miles Chen <miles.chen@...iatek.com> wrote:
>
> >In preparation for commonizing topckgen probe on various MediaTek SoCs
> >clock drivers, add the ability to register the MFG MUX notifier in
> >mtk_clk_simple_probe() by passing a custom notifier register function
> >pointer, as this function will be slightly different across different
> >SoCs.
> >
> >Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> >---
> > drivers/clk/mediatek/clk-mtk.c | 8 ++++++++
> > drivers/clk/mediatek/clk-mtk.h | 3 +++
> > 2 files changed, 11 insertions(+)
> >
> >diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
> >index b0a6225cd7b2..df6281492fb6 100644
> >--- a/drivers/clk/mediatek/clk-mtk.c
> >+++ b/drivers/clk/mediatek/clk-mtk.c
> >@@ -533,6 +533,14 @@ int mtk_clk_simple_probe(struct platform_device *pdev)
> > goto unregister_composites;
> > }
> >
> >+ if (mcd->clk_notifier_func) {
> >+ struct clk *mfg_mux = clk_data->hws[mcd->mfg_clk_idx]->clk;
> >+
> >+ r = mcd->clk_notifier_func(&pdev->dev, mfg_mux);
> >+ if (r)
> >+ goto unregister_clks;
> >+ }
>
> Should we have a IS_ERR_OR_NULL() check for clk_data->hws[mcd->mfg_clk_idx]?
With a big warning to signal that something in the driver isn't written
correctly, such as no MFG clock actually being included in the driver.
ChenYu
Powered by blists - more mailing lists