Skip to contentSkip to conversation

mfd: tps65010: remove incorrect __exit markups

PATCH In review Dmitry Torokhov 2 participants 3 messages Mar 9, 2015 – Apr 7, 2015 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: tps65010: remove incorrect __exit markups

Even if bus is not hot-pluggable, the 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.

---
 drivers/mfd/tps65010.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/tps65010.c +2 -2
index 743fb52..448f0a1 100644
@@ -515,7 +515,7 @@ static int tps65010_gpio_get(struct gpio_chip *chip, unsigned offset)
 
 static struct tps65010 *the_tps;
 
-static int __exit tps65010_remove(struct i2c_client *client)
+static int tps65010_remove(struct i2c_client *client)
 {
 	struct tps65010		*tps = i2c_get_clientdata(client);
 	struct tps65010_board	*board = dev_get_platdata(&client->dev);
@@ -684,7 +684,7 @@ static struct i2c_driver tps65010_driver = {
 		.name	= "tps65010",
 	},
 	.probe	= tps65010_probe,
-	.remove	= __exit_p(tps65010_remove),
+	.remove	= tps65010_remove,
 	.id_table = tps65010_id,
 };
 
Signature · 5 lines
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
#1 lore raw

Hi Lee,

Quoted 7 lines · Dmitry Torokhov

Even if bus is not hot-pluggable, the 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.

*ping*

Thanks.

Quoted 32 lines
---
 drivers/mfd/tps65010.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/tps65010.c +2 -2
index 743fb52..448f0a1 100644
@@ -515,7 +515,7 @@ static int tps65010_gpio_get(struct gpio_chip *chip, unsigned offset)
 
 static struct tps65010 *the_tps;
 
-static int __exit tps65010_remove(struct i2c_client *client)
+static int tps65010_remove(struct i2c_client *client)
 {
 	struct tps65010		*tps = i2c_get_clientdata(client);
 	struct tps65010_board	*board = dev_get_platdata(&client->dev);
@@ -684,7 +684,7 @@ static struct i2c_driver tps65010_driver = {
 		.name	= "tps65010",
 	},
 	.probe	= tps65010_probe,
-	.remove	= __exit_p(tps65010_remove),
+	.remove	= tps65010_remove,
 	.id_table = tps65010_id,
 };
 
Signature · 5 lines
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
Signature · 1 line
Dmitry
#2 lore raw
Quoted 9 lines · Dmitry Torokhov

Hi Lee,

Quoted 6 lines · Dmitry Torokhov

Even if bus is not hot-pluggable, the 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.

Quoted 3 lines
Quoted 1 line

*ping*

Please don't 'ping', that's what [RESEND] is for.

... but because I don't have any children and I'm not very good at teaching lessons the 'hard way', I'm going to apply this anyway. :)

Quoted 27 lines
Quoted 26 lines
---
 drivers/mfd/tps65010.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/tps65010.c +2 -2
index 743fb52..448f0a1 100644
@@ -515,7 +515,7 @@ static int tps65010_gpio_get(struct gpio_chip *chip, unsigned offset)
 
 static struct tps65010 *the_tps;
 
-static int __exit tps65010_remove(struct i2c_client *client)
+static int tps65010_remove(struct i2c_client *client)
 {
 	struct tps65010		*tps = i2c_get_clientdata(client);
 	struct tps65010_board	*board = dev_get_platdata(&client->dev);
@@ -684,7 +684,7 @@ static struct i2c_driver tps65010_driver = {
 		.name	= "tps65010",
 	},
 	.probe	= tps65010_probe,
-	.remove	= __exit_p(tps65010_remove),
+	.remove	= tps65010_remove,
 	.id_table = tps65010_id,
 };
 
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog