[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vc9LGX-=Y2smOrKuAgSRrhA0AgGuBE-0=_-q78FpSB6ag@mail.gmail.com>
Date: Tue, 9 Aug 2022 12:05:12 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Dmitry Rokosov <DDRokosov@...rdevices.ru>
Cc: Jonathan Cameron <jic23@...nel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"stano.jakubek@...il.com" <stano.jakubek@...il.com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"lars@...afoo.de" <lars@...afoo.de>,
"stephan@...hold.net" <stephan@...hold.net>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
kernel <kernel@...rdevices.ru>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/3] iio: add MEMSensing MSA311 3-axis accelerometer driver
On Tue, Aug 9, 2022 at 11:52 AM Dmitry Rokosov <DDRokosov@...rdevices.ru> wrote:
> On Sat, Aug 06, 2022 at 03:55:23PM +0100, Jonathan Cameron wrote:
> > > > > + indio_dev->modes = 0; /* setup buffered mode later */
> > > >
> > > > Why explicit assignment to 0? Doesn't kzalloc() do it for you?
> > >
> > > kzalloc() will do it for me, of course. Previously, I initialized modes to
> > > INDIO_DIRECT_MODE to just provide default value for that. Jonathan
> > > suggested to replace it with 0.
> >
> > I did? I wonder what I was smoking that day.
> > Should be set to INDIO_DIRECT_MODE as you had it previously.
> >
> > (From what I recall it will work either way but we have in the past had
> > core code that checked this and may do again in the future so drivers should
> > still be setting it to specify they provide sysfs interfaces to directly read
> > the channels).
>
> Jonathan, really sorry I referred to you. I'm confused. This comment was
> from Andy in the v3 discussion:
>
> https://lore.kernel.org/linux-iio/CAHp75Vc0+ckNnm2tzLMPrjeFRjwoj3zy0C4koNShFRG3kP8b6w@mail.gmail.com/
Indeed. I was confused by the comment. My understanding at that time
was that the triggered mode is inevitable and hence assigning to
something which _will_ be reassigned later makes a little sense. So,
does it mean that triggered mode is optional and might not be set? In
such a case the comment is misleading.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists