linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: magnetometer: ak8974: remove incorrect __exit markups
@ 2017-03-01 23:37 Dmitry Torokhov
  2017-03-05 11:29 ` Jonathan Cameron
  2017-03-05 12:57 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2017-03-01 23:37 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Linus Walleij, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

Even if bus is not hot-pluggable, devices can be unbound from the
driver via sysfs, so we should not be using __exit annotations on
remove() methods. The only exception is drivers registered with
platform_driver_probe() which specifically disables sysfs bind/unbind
attributes.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/iio/magnetometer/ak8974.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
index ce09d771c1fb..75f83424903b 100644
--- a/drivers/iio/magnetometer/ak8974.c
+++ b/drivers/iio/magnetometer/ak8974.c
@@ -767,7 +767,7 @@ static int ak8974_probe(struct i2c_client *i2c,
 	return ret;
 }
 
-static int __exit ak8974_remove(struct i2c_client *i2c)
+static int ak8974_remove(struct i2c_client *i2c)
 {
 	struct iio_dev *indio_dev = i2c_get_clientdata(i2c);
 	struct ak8974 *ak8974 = iio_priv(indio_dev);
@@ -849,7 +849,7 @@ static struct i2c_driver ak8974_driver = {
 		.of_match_table = of_match_ptr(ak8974_of_match),
 	},
 	.probe	  = ak8974_probe,
-	.remove	  = __exit_p(ak8974_remove),
+	.remove	  = ak8974_remove,
 	.id_table = ak8974_id,
 };
 module_i2c_driver(ak8974_driver);
-- 
2.12.0.rc1.440.g5b76565f74-goog


-- 
Dmitry

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: magnetometer: ak8974: remove incorrect __exit markups
  2017-03-01 23:37 [PATCH] iio: magnetometer: ak8974: remove incorrect __exit markups Dmitry Torokhov
@ 2017-03-05 11:29 ` Jonathan Cameron
  2017-03-05 12:57 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-03-05 11:29 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Linus Walleij, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

On 01/03/17 23:37, Dmitry Torokhov wrote:
> Even if bus is not hot-pluggable, devices can be unbound from the
> driver via sysfs, so we should not be using __exit annotations on
> remove() methods. The only exception is drivers registered with
> platform_driver_probe() which specifically disables sysfs bind/unbind
> attributes.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks,

Applied to the fixes-togreg branch of iio.git and marked for stable.

Jonathan
> ---
>  drivers/iio/magnetometer/ak8974.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
> index ce09d771c1fb..75f83424903b 100644
> --- a/drivers/iio/magnetometer/ak8974.c
> +++ b/drivers/iio/magnetometer/ak8974.c
> @@ -767,7 +767,7 @@ static int ak8974_probe(struct i2c_client *i2c,
>  	return ret;
>  }
>  
> -static int __exit ak8974_remove(struct i2c_client *i2c)
> +static int ak8974_remove(struct i2c_client *i2c)
>  {
>  	struct iio_dev *indio_dev = i2c_get_clientdata(i2c);
>  	struct ak8974 *ak8974 = iio_priv(indio_dev);
> @@ -849,7 +849,7 @@ static struct i2c_driver ak8974_driver = {
>  		.of_match_table = of_match_ptr(ak8974_of_match),
>  	},
>  	.probe	  = ak8974_probe,
> -	.remove	  = __exit_p(ak8974_remove),
> +	.remove	  = ak8974_remove,
>  	.id_table = ak8974_id,
>  };
>  module_i2c_driver(ak8974_driver);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: magnetometer: ak8974: remove incorrect __exit markups
  2017-03-01 23:37 [PATCH] iio: magnetometer: ak8974: remove incorrect __exit markups Dmitry Torokhov
  2017-03-05 11:29 ` Jonathan Cameron
@ 2017-03-05 12:57 ` Linus Walleij
  2017-03-05 13:54   ` Jonathan Cameron
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2017-03-05 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

On Thu, Mar 2, 2017 at 12:37 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> Even if bus is not hot-pluggable, devices can be unbound from the
> driver via sysfs, so we should not be using __exit annotations on
> remove() methods. The only exception is drivers registered with
> platform_driver_probe() which specifically disables sysfs bind/unbind
> attributes.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks!
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: magnetometer: ak8974: remove incorrect __exit markups
  2017-03-05 12:57 ` Linus Walleij
@ 2017-03-05 13:54   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-03-05 13:54 UTC (permalink / raw)
  To: Linus Walleij, Dmitry Torokhov
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

On 05/03/17 12:57, Linus Walleij wrote:
> On Thu, Mar 2, 2017 at 12:37 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> 
>> Even if bus is not hot-pluggable, devices can be unbound from the
>> driver via sysfs, so we should not be using __exit annotations on
>> remove() methods. The only exception is drivers registered with
>> platform_driver_probe() which specifically disables sysfs bind/unbind
>> attributes.
>>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Added.
> 
> Thanks!
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-05 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 23:37 [PATCH] iio: magnetometer: ak8974: remove incorrect __exit markups Dmitry Torokhov
2017-03-05 11:29 ` Jonathan Cameron
2017-03-05 12:57 ` Linus Walleij
2017-03-05 13:54   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).