All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
Cc: pmeerw@pmeerw.net, knaack.h@gmx.de, lars@metafoo.de,
	Daniel Baluta <daniel.baluta@nxp.com>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH v7 10/10] iio: light: rpr0521 iio_device_register to devm_
Date: Tue, 4 Jul 2017 20:47:55 +0100	[thread overview]
Message-ID: <20170704204755.404abac0@kernel.org> (raw)
In-Reply-To: <1499086214-1811-3-git-send-email-mikko.koivunen@fi.rohmeurope.com>

On Mon,  3 Jul 2017 15:50:14 +0300
Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com> wrote:

> Change iio_device_register to devm_
> 
> --
> 
>  drivers/iio/light/rpr0521.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
> index a6efa126..4c090d0 100644
> --- a/drivers/iio/light/rpr0521.c
> +++ b/drivers/iio/light/rpr0521.c
> @@ -1029,7 +1029,7 @@ static int rpr0521_probe(struct i2c_client *client,
>  		}
>  	}
>  
> -	ret = iio_device_register(indio_dev);
> +	ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev);
>  	if (ret)
>  		goto err_pm_disable;
>  
> @@ -1049,8 +1049,6 @@ static int rpr0521_remove(struct i2c_client *client)
>  {
>  	struct iio_dev *indio_dev = i2c_get_clientdata(client);
>  
> -	iio_device_unregister(indio_dev);
> -
Given this now means you turn the power off before you remove the userspace
interfaces (and in kernel ones) this is a very bad idea.  

So dropping this patch.

Thanks,

Jonathan
>  	pm_runtime_disable(&client->dev);
>  	pm_runtime_set_suspended(&client->dev);
>  	pm_runtime_put_noidle(&client->dev);


      reply	other threads:[~2017-07-04 19:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 12:50 [PATCH v7 00/10] iio: light: rpr0521 Mikko Koivunen
2017-07-03 12:50 ` [PATCH v7 09/10] iio: light: rpr0521 triggered buffer Mikko Koivunen
2017-07-04 19:48   ` Jonathan Cameron
2017-07-05  6:34     ` Koivunen, Mikko
2017-07-03 12:50 ` [PATCH v7 10/10] iio: light: rpr0521 iio_device_register to devm_ Mikko Koivunen
2017-07-04 19:47   ` Jonathan Cameron [this message]

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=20170704204755.404abac0@kernel.org \
    --to=jic23@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=mikko.koivunen@fi.rohmeurope.com \
    --cc=pmeerw@pmeerw.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.