Hi Bin,

> -----Original Message-----
> From: Sagar Kadam
> Sent: Thursday, June 25, 2020 10:17 AM
> To: Bin Meng <bmeng...@gmail.com>
> Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Rick Chen
> <r...@andestech.com>; Lukasz Majewski <lu...@denx.de>; Jagan Teki
> <ja...@amarulasolutions.com>; Pragnesh Patel
> <pragnesh.pa...@sifive.com>; Anup Patel <anup.pa...@wdc.com>; Simon
> Glass <s...@chromium.org>; Sean Anderson <sean...@gmail.com>
> Subject: RE: [PATCH v4 1/4] fu540: prci: add request and free clock handlers
> 
> Hi Bin,
> 
> > -----Original Message-----
> > From: Bin Meng <bmeng...@gmail.com>
> > Sent: Thursday, June 25, 2020 4:51 AM
> > To: Sagar Kadam <sagar.ka...@sifive.com>
> > Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Rick Chen
> > <r...@andestech.com>; Lukasz Majewski <lu...@denx.de>; Jagan Teki
> > <ja...@amarulasolutions.com>; Pragnesh Patel
> > <pragnesh.pa...@sifive.com>; Anup Patel <anup.pa...@wdc.com>; Simon
> > Glass <s...@chromium.org>; Sean Anderson <sean...@gmail.com>
> > Subject: Re: [PATCH v4 1/4] fu540: prci: add request and free clock
> > handlers
> >
> > [External Email] Do not click links or attachments unless you
> > recognize the sender and know the content is safe
> >
> > Hi Sagar,
> >
> > On Wed, Jun 24, 2020 at 6:58 PM Sagar Kadam <sagar.ka...@sifive.com>
> > wrote:
> > >
> > > Hi Bin,
> > >
> > > > -----Original Message-----
> > > > From: Bin Meng <bmeng...@gmail.com>
> > > > Sent: Wednesday, June 24, 2020 6:50 AM
> > > > To: Sagar Kadam <sagar.ka...@sifive.com>
> > > > Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Rick Chen
> > > > <r...@andestech.com>; Lukasz Majewski <lu...@denx.de>; Jagan
> Teki
> > > > <ja...@amarulasolutions.com>; Pragnesh Patel
> > > > <pragnesh.pa...@sifive.com>; Anup Patel <anup.pa...@wdc.com>;
> > Simon
> > > > Glass <s...@chromium.org>; Sean Anderson <sean...@gmail.com>
> > > > Subject: Re: [PATCH v4 1/4] fu540: prci: add request and free
> > > > clock
> > handlers
> > > >
> > > > [External Email] Do not click links or attachments unless you
> > > > recognize
> > the
> > > > sender and know the content is safe
> > > >
> > > > Hi Sagar,
> > > >
> > > > On Sun, Jun 21, 2020 at 9:10 PM Sagar Shrikant Kadam
> > > > <sagar.ka...@sifive.com> wrote:
> > > > >
> > > > > Add clk_request handler to check if a valid clock is requested.
> > > > > Here clk_free handler is added for debug purpose which will
> > > > > display details of clock passed to clk_free.
> > > > >
> > > > > Signed-off-by: Sagar Shrikant Kadam <sagar.ka...@sifive.com>
> > > > > Reviewed-by: Pragnesh Patel <pragnesh.pa...@sifive.com>
> > > > > ---
> > > > >  drivers/clk/sifive/fu540-prci.c | 21 +++++++++++++++++++++
> > > > >  1 file changed, 21 insertions(+)
> > > > >
> > > > > diff --git a/drivers/clk/sifive/fu540-prci.c
> > > > > b/drivers/clk/sifive/fu540-prci.c index fe6e0d4..9a9ff6b 100644
> > > > > --- a/drivers/clk/sifive/fu540-prci.c
> > > > > +++ b/drivers/clk/sifive/fu540-prci.c
> > > > > @@ -686,6 +686,25 @@ static ulong
> > > > > sifive_fu540_prci_set_rate(struct
> > clk
> > > > *clk, ulong rate)
> > > > >         return rate;
> > > > >  }
> > > > >
> > > > > +static int sifive_fu540_prci_clk_request(struct clk *clk) {
> > > > > +       debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk-
> >dev,
> > > > > +             clk->id);
> > > > > +
> > > > > +       if (clk->id >= ARRAY_SIZE(__prci_init_clocks))
> > > > > +               return -EINVAL;
> > > > > +
> > > > > +       return 0;
> > > > > +}
> > > > > +
> > > > > +static int sifive_fu540_prci_clk_free(struct clk *clk) {
> > > > > +       debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk-
> >dev,
> > > > > +             clk->id);
> > > > > +
> > > > > +       return 0;
> > > > > +}
> > > >
> > > > It seems these 2 routines do not actually do anything? Is this for
> > debugging
> > > > purposes?
> > > >
> > > The sifive_fu540_prci_clk_request will check if the clock requested
> > > is valid
> > or not.
> > > While the sifive_fu540_prci_clk_free function is just for debug.
> > > Is it ok if I retain these in V5 or you have some other thought here.
> > >
> >
> > OK, but I suspect the parameter check in
> > sifive_fu540_prci_clk_request() is not necessary too as currently the
> > codes work well.
> >
> 
> Ok. In that case I will than drop the check in sifive_fu540_prci_clk_request()
> and just keep the debug info.
> 
> Thanks & BR,
> Sagar
> 
Missed to add:
I had referred to other reference driver's and thought of keeping it.
So I'll drop this patch in V5 as it is not much value addition here.
Sorry for the confusion

Thanks & BR,
Sagar 

> > Regards,
> > Bin

Reply via email to