public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <ardeleanalex@gmail.com>
Cc: Gwendal Grignou <gwendal@chromium.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2 2/7] iio: fix devm_iio_trigger_alloc with parent.cocci
Date: Sun, 13 Dec 2020 17:45:26 +0000	[thread overview]
Message-ID: <20201213174526.5d81c7bb@archlinux> (raw)
In-Reply-To: <CA+U=DsrGAUP_T4rd_L0ctp6Drm35DcGEzTaJv=uVxO5JufVabQ@mail.gmail.com>

On Fri, 11 Dec 2020 09:47:58 +0200
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> On Thu, Dec 10, 2020 at 10:42 PM Gwendal Grignou <gwendal@chromium.org> wrote:
> >
> > Use cocci semantic patch:
> > @@
> > expression trigger, P, name;
> > @@
> >    trigger = devm_iio_trigger_alloc(P, ...);
> >    ...
> > -  trigger->dev.parent = P;
> >
> > To remove trigger->dev.parent, since it is set by default.
> >  
> 
> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> 
> > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>

There's a bonus one in here :)

Otherwise looks good.

Jonathan




> > diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c
> > index 765c44adac57..e732d308ac4e 100644
> > --- a/drivers/iio/light/vcnl4035.c
> > +++ b/drivers/iio/light/vcnl4035.c
> > @@ -511,7 +511,6 @@ static int vcnl4035_probe_trigger(struct iio_dev *indio_dev)
> >         if (!data->drdy_trigger0)
> >                 return -ENOMEM;
> >
> > -       data->drdy_trigger0->dev.parent = indio_dev->dev.parent;
> >         data->drdy_trigger0->ops = &vcnl4035_trigger_ops;
> >         iio_trigger_set_drvdata(data->drdy_trigger0, indio_dev);
> >         ret = devm_iio_trigger_register(indio_dev->dev.parent,

This one is a bit obscured by the code.  I wonder it it would be sensible to
just pass the client->dev directly into vcnl4035_probe_trigger rather than
somewhat making us guess where it goes. Unrelated to your patch though.

> > diff --git a/drivers/iio/proximity/sx932x.c b/drivers/iio/proximity/sx932x.c
> > index 26503348ce85..95ad49e627c6 100644
> > --- a/drivers/iio/proximity/sx932x.c
> > +++ b/drivers/iio/proximity/sx932x.c
> > @@ -1336,7 +1336,6 @@ static int sx932x_probe(struct i2c_client *client,
> >                 if (!data->trig)
> >                         return -ENOMEM;
> >
> > -               data->trig->dev.parent = &client->dev;
> >                 data->trig->ops = &sx932x_trigger_ops;
> >                 iio_trigger_set_drvdata(data->trig, indio_dev);

There is no such driver in mainline yet.

I had the sudden horror that I'd let another wild card name in without
noticing and checked :)  We had a v1 of the patch, but currently
waiting for v2.

Jonathan

> >
> > --
> > 2.29.2.576.ga3fc446d84-goog
> >  


  reply	other threads:[~2020-12-13 17:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 20:42 [PATCH v2 0/7] iio: Set default trigger device parent Gwendal Grignou
2020-12-10 20:42 ` [PATCH v2 1/7] iio: set default trig->dev.parent Gwendal Grignou
2020-12-11  7:45   ` Alexandru Ardelean
2020-12-13 17:46     ` Jonathan Cameron
2020-12-29 17:38   ` Jonathan Cameron
2020-12-10 20:42 ` [PATCH v2 2/7] iio: fix devm_iio_trigger_alloc with parent.cocci Gwendal Grignou
2020-12-11  7:47   ` Alexandru Ardelean
2020-12-13 17:45     ` Jonathan Cameron [this message]
2020-12-10 20:42 ` [PATCH v2 3/7] iio: adis_trigger: Remove code to set trigger parent Gwendal Grignou
2020-12-11  7:48   ` Alexandru Ardelean
2020-12-10 20:42 ` [PATCH v2 4/7] iio: gp2ap020a00f: " Gwendal Grignou
2020-12-11  7:49   ` Alexandru Ardelean
2020-12-10 20:42 ` [PATCH v2 5/7] iio: lmp91000: " Gwendal Grignou
2020-12-11  8:04   ` Alexandru Ardelean
2020-12-10 20:42 ` [PATCH v2 6/7] iio: chemical: atlas: " Gwendal Grignou
2020-12-11  8:05   ` Alexandru Ardelean
2020-12-10 20:42 ` [PATCH v2 7/7] iio: as3935: " Gwendal Grignou
2020-12-11  8:07   ` Alexandru Ardelean
2020-12-13 17:52     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201213174526.5d81c7bb@archlinux \
    --to=jic23@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=ardeleanalex@gmail.com \
    --cc=gwendal@chromium.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox