* [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit
@ 2010-09-13 8:29 Shubhrajyoti D
2010-09-13 9:22 ` [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and Michael Lawnick
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Shubhrajyoti D @ 2010-09-13 8:29 UTC (permalink / raw)
To: lm-sensors
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
---
drivers/hwmon/lm75.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index ab5b87a..028f961 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -134,7 +134,7 @@ static const struct attribute_group lm75_group = {
/* device probe and removal */
-static int
+static int __devinit
lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct lm75_data *data;
@@ -196,7 +196,7 @@ exit_free:
return status;
}
-static int lm75_remove(struct i2c_client *client)
+static int __devexit lm75_remove(struct i2c_client *client)
{
struct lm75_data *data = i2c_get_clientdata(client);
@@ -325,7 +325,7 @@ static struct i2c_driver lm75_driver = {
.pm = LM75_DEV_PM_OPS,
},
.probe = lm75_probe,
- .remove = lm75_remove,
+ .remove = __devexit_p(lm75_remove),
.id_table = lm75_ids,
.detect = lm75_detect,
.address_list = normal_i2c,
--
1.7.0.4
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
2010-09-13 8:29 [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit Shubhrajyoti D
@ 2010-09-13 9:22 ` Michael Lawnick
2010-09-13 10:52 ` Datta, Shubhrajyoti
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Michael Lawnick @ 2010-09-13 9:22 UTC (permalink / raw)
To: lm-sensors
Shubhrajyoti D said the following:
...
> -static int
> +static int __devinit
> lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
Are you sure?
If I understand correctly, this function will be thrown away after
system/module init. But what's about devices that are added later?
I would expect them to crash on init...
--
KR
Michael
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
2010-09-13 8:29 [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit Shubhrajyoti D
2010-09-13 9:22 ` [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and Michael Lawnick
@ 2010-09-13 10:52 ` Datta, Shubhrajyoti
2010-09-13 11:12 ` Michael Lawnick
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Datta, Shubhrajyoti @ 2010-09-13 10:52 UTC (permalink / raw)
To: lm-sensors
> -----Original Message-----
> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
> Sent: Monday, September 13, 2010 2:52 PM
> To: Datta, Shubhrajyoti
> Cc: lm-sensors@lm-sensors.org
> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
> __devexit section initializers
>
> Shubhrajyoti D said the following:
> ...
>
> > -static int
> > +static int __devinit
> > lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
> Are you sure?
> If I understand correctly, this function will be thrown away after
> system/module init. But what's about devices that are added later?
> I would expect them to crash on init...
As all of these are I2C devices are I2C I thought it makes sense.
Are you aware of devices that can be plugged/wired runtime?
>
> --
> KR
> Michael
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
2010-09-13 8:29 [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit Shubhrajyoti D
2010-09-13 9:22 ` [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and Michael Lawnick
2010-09-13 10:52 ` Datta, Shubhrajyoti
@ 2010-09-13 11:12 ` Michael Lawnick
2010-09-13 11:46 ` Datta, Shubhrajyoti
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Michael Lawnick @ 2010-09-13 11:12 UTC (permalink / raw)
To: lm-sensors
Datta, Shubhrajyoti said the following:
>
>
>> -----Original Message-----
>> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
>> Sent: Monday, September 13, 2010 2:52 PM
>> To: Datta, Shubhrajyoti
>> Cc: lm-sensors@lm-sensors.org
>> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
>> __devexit section initializers
>>
>> Shubhrajyoti D said the following:
>> ...
>>
>> > -static int
>> > +static int __devinit
>> > lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
>> Are you sure?
>> If I understand correctly, this function will be thrown away after
>> system/module init. But what's about devices that are added later?
>> I would expect them to crash on init...
> As all of these are I2C devices are I2C I thought it makes sense.
> Are you aware of devices that can be plugged/wired runtime?
Almost all if behind a multiplexer ;-)
There is just some care in synchronization needed.
We are currently working with such a system that dynamically adds buses
and drops them again (triggered by hotplug).
--
KR
Michael
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
2010-09-13 8:29 [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit Shubhrajyoti D
` (2 preceding siblings ...)
2010-09-13 11:12 ` Michael Lawnick
@ 2010-09-13 11:46 ` Datta, Shubhrajyoti
2010-09-13 12:18 ` Michael Lawnick
2010-09-13 14:49 ` Guenter Roeck
5 siblings, 0 replies; 7+ messages in thread
From: Datta, Shubhrajyoti @ 2010-09-13 11:46 UTC (permalink / raw)
To: lm-sensors
> -----Original Message-----
> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
> Sent: Monday, September 13, 2010 4:42 PM
> To: Datta, Shubhrajyoti
> Cc: lm-sensors@lm-sensors.org
> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
> __devexit section initializers
>
> Datta, Shubhrajyoti said the following:
> >
> >
> >> -----Original Message-----
> >> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
> >> Sent: Monday, September 13, 2010 2:52 PM
> >> To: Datta, Shubhrajyoti
> >> Cc: lm-sensors@lm-sensors.org
> >> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
> >> __devexit section initializers
> >>
> >> Shubhrajyoti D said the following:
> >> ...
> >>
> >> > -static int
> >> > +static int __devinit
> >> > lm75_probe(struct i2c_client *client, const struct i2c_device_id
> *id)
> >> Are you sure?
> >> If I understand correctly, this function will be thrown away after
> >> system/module init. But what's about devices that are added later?
> >> I would expect them to crash on init...
> > As all of these are I2C devices are I2C I thought it makes sense.
> > Are you aware of devices that can be plugged/wired runtime?
>
> Almost all if behind a multiplexer ;-)
I missed this part.
> There is just some care in synchronization needed.
> We are currently working with such a system that dynamically adds buses
> and drops them again (triggered by hotplug).
Does it mean that all the existing drivers need to adapt.
> --
> KR
> Michael
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
2010-09-13 8:29 [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit Shubhrajyoti D
` (3 preceding siblings ...)
2010-09-13 11:46 ` Datta, Shubhrajyoti
@ 2010-09-13 12:18 ` Michael Lawnick
2010-09-13 14:49 ` Guenter Roeck
5 siblings, 0 replies; 7+ messages in thread
From: Michael Lawnick @ 2010-09-13 12:18 UTC (permalink / raw)
To: lm-sensors
Datta, Shubhrajyoti said the following:
>
>
>> -----Original Message-----
>> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
>> Sent: Monday, September 13, 2010 4:42 PM
>> To: Datta, Shubhrajyoti
>> Cc: lm-sensors@lm-sensors.org
>> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
>> __devexit section initializers
>>
>> Datta, Shubhrajyoti said the following:
>> >
>> >
>> >> -----Original Message-----
>> >> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
>> >> Sent: Monday, September 13, 2010 2:52 PM
>> >> To: Datta, Shubhrajyoti
>> >> Cc: lm-sensors@lm-sensors.org
>> >> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
>> >> __devexit section initializers
>> >>
>> >> Shubhrajyoti D said the following:
>> >> ...
>> >>
>> >> > -static int
>> >> > +static int __devinit
>> >> > lm75_probe(struct i2c_client *client, const struct i2c_device_id
>> *id)
>> >> Are you sure?
>> >> If I understand correctly, this function will be thrown away after
>> >> system/module init. But what's about devices that are added later?
>> >> I would expect them to crash on init...
>> > As all of these are I2C devices are I2C I thought it makes sense.
>> > Are you aware of devices that can be plugged/wired runtime?
>>
>> Almost all if behind a multiplexer ;-)
> I missed this part.
There even exist multiplexer that check the bus state and allow
connection only within stop<->start phases.
>
>> There is just some care in synchronization needed.
>> We are currently working with such a system that dynamically adds buses
>> and drops them again (triggered by hotplug).
> Does it mean that all the existing drivers need to adapt.
I expect them to get adapted step by step when/if this really becomes an
issue. Maybe someday a general cleanup will necessary (and done). Anyway
this might be already an issue for hot plugged cards (e.g. a compact PCI
TV card) that has a local i2c adapter on and common devices on its local
bus. But either this scenario does not exist in practical life or was
fixed by a local code fix.
--
KR
Michael
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
2010-09-13 8:29 [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit Shubhrajyoti D
` (4 preceding siblings ...)
2010-09-13 12:18 ` Michael Lawnick
@ 2010-09-13 14:49 ` Guenter Roeck
5 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2010-09-13 14:49 UTC (permalink / raw)
To: lm-sensors
On Mon, Sep 13, 2010 at 08:18:08AM -0400, Michael Lawnick wrote:
> Datta, Shubhrajyoti said the following:
> >
> >
> >> -----Original Message-----
> >> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
> >> Sent: Monday, September 13, 2010 4:42 PM
> >> To: Datta, Shubhrajyoti
> >> Cc: lm-sensors@lm-sensors.org
> >> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
> >> __devexit section initializers
> >>
> >> Datta, Shubhrajyoti said the following:
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: Michael Lawnick [mailto:ml.lawnick@gmx.de]
> >> >> Sent: Monday, September 13, 2010 2:52 PM
> >> >> To: Datta, Shubhrajyoti
> >> >> Cc: lm-sensors@lm-sensors.org
> >> >> Subject: Re: [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and
> >> >> __devexit section initializers
> >> >>
> >> >> Shubhrajyoti D said the following:
> >> >> ...
> >> >>
> >> >> > -static int
> >> >> > +static int __devinit
> >> >> > lm75_probe(struct i2c_client *client, const struct i2c_device_id
> >> *id)
> >> >> Are you sure?
> >> >> If I understand correctly, this function will be thrown away after
> >> >> system/module init. But what's about devices that are added later?
> >> >> I would expect them to crash on init...
> >> > As all of these are I2C devices are I2C I thought it makes sense.
> >> > Are you aware of devices that can be plugged/wired runtime?
> >>
> >> Almost all if behind a multiplexer ;-)
> > I missed this part.
> There even exist multiplexer that check the bus state and allow
> connection only within stop<->start phases.
> >
> >> There is just some care in synchronization needed.
> >> We are currently working with such a system that dynamically adds buses
> >> and drops them again (triggered by hotplug).
> > Does it mean that all the existing drivers need to adapt.
>
> I expect them to get adapted step by step when/if this really becomes an
> issue. Maybe someday a general cleanup will necessary (and done). Anyway
> this might be already an issue for hot plugged cards (e.g. a compact PCI
> TV card) that has a local i2c adapter on and common devices on its local
> bus. But either this scenario does not exist in practical life or was
> fixed by a local code fix.
>
This is an interesting use case. I didn't think about it either.
Looking through other drivers, it seems to be common that __devinit and __devexit
are used only if the device is known to be static. Some even make a destinction
based on the interface type (eg lm78).
As such, it may be better not to apply this patch.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-09-13 14:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-13 8:29 [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and __devexit Shubhrajyoti D
2010-09-13 9:22 ` [lm-sensors] [PATCH v3] hwmon: lm75: Add __devinit and Michael Lawnick
2010-09-13 10:52 ` Datta, Shubhrajyoti
2010-09-13 11:12 ` Michael Lawnick
2010-09-13 11:46 ` Datta, Shubhrajyoti
2010-09-13 12:18 ` Michael Lawnick
2010-09-13 14:49 ` Guenter Roeck
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.