* [lm-sensors] [PATCH RFT] hwmon: (gpio-fan) Convert to devm_hwmon_device_register_with_groups
@ 2014-06-14 6:50 Axel Lin
2014-06-14 13:26 ` Guenter Roeck
2014-07-09 15:19 ` Simon Guinot
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-06-14 6:50 UTC (permalink / raw)
To: lm-sensors
This simplifies the code a bit and also ensures the attribute groups are
properly removed from sysfs when unload the module.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/hwmon/gpio-fan.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index ba35e4d..2abfc3f 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -537,9 +537,10 @@ static int gpio_fan_probe(struct platform_device *pdev)
}
/* Make this driver part of hwmon class. */
- fan_data->hwmon_dev = hwmon_device_register_with_groups(&pdev->dev,
- "gpio-fan", fan_data,
- gpio_fan_groups);
+ fan_data->hwmon_dev + devm_hwmon_device_register_with_groups(&pdev->dev,
+ "gpio-fan", fan_data,
+ gpio_fan_groups);
if (IS_ERR(fan_data->hwmon_dev))
return PTR_ERR(fan_data->hwmon_dev);
@@ -548,15 +549,6 @@ static int gpio_fan_probe(struct platform_device *pdev)
return 0;
}
-static int gpio_fan_remove(struct platform_device *pdev)
-{
- struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
-
- hwmon_device_unregister(fan_data->hwmon_dev);
-
- return 0;
-}
-
#ifdef CONFIG_PM_SLEEP
static int gpio_fan_suspend(struct device *dev)
{
@@ -588,7 +580,6 @@ static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
static struct platform_driver gpio_fan_driver = {
.probe = gpio_fan_probe,
- .remove = gpio_fan_remove,
.driver = {
.name = "gpio-fan",
.pm = GPIO_FAN_PM,
--
1.8.3.2
_______________________________________________
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 RFT] hwmon: (gpio-fan) Convert to devm_hwmon_device_register_with_groups
2014-06-14 6:50 [lm-sensors] [PATCH RFT] hwmon: (gpio-fan) Convert to devm_hwmon_device_register_with_groups Axel Lin
@ 2014-06-14 13:26 ` Guenter Roeck
2014-07-09 15:19 ` Simon Guinot
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2014-06-14 13:26 UTC (permalink / raw)
To: lm-sensors
On 06/13/2014 11:50 PM, Axel Lin wrote:
> This simplifies the code a bit and also ensures the attribute groups are
> properly removed from sysfs when unload the module.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Hmm ... no idea why I did not use the devm_ function to start with. Applied to -next.
On a side note, I wonder if the interrupt handler works on this one.
Shared edge triggered interrupts used to be not supported, or my memory is wrong.
If I find some time, I may build a little test board to give this a try.
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 RFT] hwmon: (gpio-fan) Convert to devm_hwmon_device_register_with_groups
2014-06-14 6:50 [lm-sensors] [PATCH RFT] hwmon: (gpio-fan) Convert to devm_hwmon_device_register_with_groups Axel Lin
2014-06-14 13:26 ` Guenter Roeck
@ 2014-07-09 15:19 ` Simon Guinot
1 sibling, 0 replies; 3+ messages in thread
From: Simon Guinot @ 2014-07-09 15:19 UTC (permalink / raw)
To: lm-sensors
[-- Attachment #1.1: Type: text/plain, Size: 737 bytes --]
On Sat, Jun 14, 2014 at 06:26:00AM -0700, Guenter Roeck wrote:
> On 06/13/2014 11:50 PM, Axel Lin wrote:
> >This simplifies the code a bit and also ensures the attribute groups are
> >properly removed from sysfs when unload the module.
> >
> >Signed-off-by: Axel Lin <axel.lin@ingics.com>
>
> Hmm ... no idea why I did not use the devm_ function to start with. Applied to -next.
>
> On a side note, I wonder if the interrupt handler works on this one.
> Shared edge triggered interrupts used to be not supported, or my memory is wrong.
> If I find some time, I may build a little test board to give this a try.
Hi Guenter,
Last time I checked it was OK with my ns2 Max board (DTS file
kirkwood-ns2max.dts).
Simon
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 153 bytes --]
_______________________________________________
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:[~2014-07-09 15:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-14 6:50 [lm-sensors] [PATCH RFT] hwmon: (gpio-fan) Convert to devm_hwmon_device_register_with_groups Axel Lin
2014-06-14 13:26 ` Guenter Roeck
2014-07-09 15:19 ` Simon Guinot
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.