* [lm-sensors] [PATCH 1/3] hwmon: (lm90) Unregister hwmon device if interrupt setup fails
@ 2013-11-27 18:04 Guenter Roeck
2013-11-27 18:26 ` Guenter Roeck
2013-12-01 10:56 ` Jean Delvare
0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2013-11-27 18:04 UTC (permalink / raw)
To: lm-sensors
Commit 109b1283fb (hwmon: (lm90) Add support to handle IRQ) introduced
interrupt support. Its error handling code fails to unregister the already
registered hwmon device.
Fixes: 109b1283fb532ac773a076748ffccf76a7067cab
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/lm90.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 4c4c142..8b8f3aa 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -1610,12 +1610,14 @@ static int lm90_probe(struct i2c_client *client,
"lm90", client);
if (err < 0) {
dev_err(dev, "cannot request IRQ %d\n", client->irq);
- goto exit_remove_files;
+ goto exit_unregister;
}
}
return 0;
+exit_unregister:
+ hwmon_device_unregister(data->hwmon_dev);
exit_remove_files:
lm90_remove_files(client, data);
exit_restore:
--
1.7.9.7
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [lm-sensors] [PATCH 1/3] hwmon: (lm90) Unregister hwmon device if interrupt setup fails
2013-11-27 18:04 [lm-sensors] [PATCH 1/3] hwmon: (lm90) Unregister hwmon device if interrupt setup fails Guenter Roeck
@ 2013-11-27 18:26 ` Guenter Roeck
2013-12-01 10:56 ` Jean Delvare
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2013-11-27 18:26 UTC (permalink / raw)
To: lm-sensors
On 11/27/2013 10:04 AM, Guenter Roeck wrote:
> Commit 109b1283fb (hwmon: (lm90) Add support to handle IRQ) introduced
> interrupt support. Its error handling code fails to unregister the already
> registered hwmon device.
>
> Fixes: 109b1283fb532ac773a076748ffccf76a7067cab
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/hwmon/lm90.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
> index 4c4c142..8b8f3aa 100644
> --- a/drivers/hwmon/lm90.c
> +++ b/drivers/hwmon/lm90.c
> @@ -1610,12 +1610,14 @@ static int lm90_probe(struct i2c_client *client,
> "lm90", client);
> if (err < 0) {
> dev_err(dev, "cannot request IRQ %d\n", client->irq);
> - goto exit_remove_files;
> + goto exit_unregister;
> }
> }
>
> return 0;
>
> +exit_unregister:
> + hwmon_device_unregister(data->hwmon_dev);
> exit_remove_files:
> lm90_remove_files(client, data);
> exit_restore:
>
Hi Jean,
please ignore the 1/3 in the headline. The other two patches are the conversion
to hwmon_device_register_with_groups which I'll need to test first.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [lm-sensors] [PATCH 1/3] hwmon: (lm90) Unregister hwmon device if interrupt setup fails
2013-11-27 18:04 [lm-sensors] [PATCH 1/3] hwmon: (lm90) Unregister hwmon device if interrupt setup fails Guenter Roeck
2013-11-27 18:26 ` Guenter Roeck
@ 2013-12-01 10:56 ` Jean Delvare
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2013-12-01 10:56 UTC (permalink / raw)
To: lm-sensors
Hi Guenter,
On Wed, 27 Nov 2013 10:04:46 -0800, Guenter Roeck wrote:
> Commit 109b1283fb (hwmon: (lm90) Add support to handle IRQ) introduced
> interrupt support. Its error handling code fails to unregister the already
> registered hwmon device.
>
> Fixes: 109b1283fb532ac773a076748ffccf76a7067cab
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/hwmon/lm90.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
> index 4c4c142..8b8f3aa 100644
> --- a/drivers/hwmon/lm90.c
> +++ b/drivers/hwmon/lm90.c
> @@ -1610,12 +1610,14 @@ static int lm90_probe(struct i2c_client *client,
> "lm90", client);
> if (err < 0) {
> dev_err(dev, "cannot request IRQ %d\n", client->irq);
> - goto exit_remove_files;
> + goto exit_unregister;
> }
> }
>
> return 0;
>
> +exit_unregister:
> + hwmon_device_unregister(data->hwmon_dev);
> exit_remove_files:
> lm90_remove_files(client, data);
> exit_restore:
Good catch, thanks for reporting and sorry for missing this during my
code review. Applied.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-01 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 18:04 [lm-sensors] [PATCH 1/3] hwmon: (lm90) Unregister hwmon device if interrupt setup fails Guenter Roeck
2013-11-27 18:26 ` Guenter Roeck
2013-12-01 10:56 ` Jean Delvare
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.