Re: [PATCH 04/10] Coresight: Enable BC and GPR for TPDM driver

From: Mathieu Poirier
Date: Fri Nov 05 2021 - 11:14:36 EST


On Fri, Nov 05, 2021 at 04:17:54PM +0800, Jinlong wrote:
> On Thu, Nov 04, 2021 at 11:02:24AM -0600, Mathieu Poirier wrote:
> > [...]
> >
> > > > > +
> > > > > +static ssize_t reset_store(struct device *dev,
> > > > > + struct device_attribute *attr,
> > > > > + const char *buf,
> > > > > + size_t size)
> > > > > +{
> > > > > + int ret = 0;
> > > > > + unsigned long val;
> > > > > + struct mcmb_dataset *mcmb_temp = NULL;
> > > > > + struct tpdm_drvdata *drvdata = dev_get_drvdata(dev->parent);
> > > > > +
> > > > > + ret = kstrtoul(buf, 10, &val);
> > > >
> > > > The coresight subsystem normally uses the hexadecimal base.
> > > >
> > >
> > > We will address you comments.
> > >
> > > > > + if (ret)
> > > > > + return ret;
> > > >
> > > > Shouldn't this be "if (!ret)" ?
> > > >
> > >
> > > When ret is not 0, it need to return.
> >
> > I would expect something like this:
> >
> > $ echo 1 > /sys/path/to/tpdm/device/reset
> >
> > and not
> >
> > $ echo 0 > /sys/path/to/tpdm/device/reset
> >
> > The latter is what the code does.
> >
> > Thanks,
> > Mathieu
> >
>
> Hi Mathieu,
>
> The ret is the result of kstrtoul not the val.
>

Ah yes, you are correct.