All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [lm-sensors] [PATCH v4] hwmon: Versatile Express hwmon driver
Date: Fri, 21 Sep 2012 18:18:44 +0000	[thread overview]
Message-ID: <20120921181844.GA20763@roeck-us.net> (raw)
In-Reply-To: <1348246591-2409-1-git-send-email-mail@pawelmoll.com>

On Fri, Sep 21, 2012 at 05:56:31PM +0100, Pawel Moll wrote:
> From: Pawel Moll <pawel.moll@arm.com>
> 
> hwmon framework driver for Versatile Express sensors, providing
> information about board level voltage (only when regulator driver
> is not configured), currents, temperature and power/energy usage.
> Labels for the values can be defined as DT properties.
> 
> Signed-off-by: Pawel Moll <pawel.moll@arm.com>
> ---
>  .../devicetree/bindings/hwmon/vexpress.txt         |   23 ++
>  Documentation/hwmon/vexpress                       |   34 +++
>  drivers/hwmon/Kconfig                              |    8 +
>  drivers/hwmon/Makefile                             |    1 +
>  drivers/hwmon/vexpress.c                           |  229 ++++++++++++++++++++
>  5 files changed, 295 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/vexpress.txt
>  create mode 100644 Documentation/hwmon/vexpress
>  create mode 100644 drivers/hwmon/vexpress.c
> 
[ ... ]

> +
> +	err = sysfs_create_group(&pdev->dev.kobj, match->data);
> +	if (err)
> +		goto error;

You'll need a second label for that. Since the group was not created, you can
not delete it.

> +
> +	data->hwmon_dev = hwmon_device_register(&pdev->dev);
> +	if (IS_ERR(data->hwmon_dev)) {
> +		err = PTR_ERR(data->hwmon_dev);
> +		goto error;
> +	}
> +
> +	return 0;
> +
> +error:
> +	sysfs_remove_group(&pdev->dev.kobj, match->data);
> +	vexpress_config_func_put(data->func);
> +	return err;
> +}
> +
> +static int __devexit vexpress_hwmon_remove(struct platform_device *pdev)
> +{
> +	struct vexpress_hwmon_data *data = platform_get_drvdata(pdev);
> +	const struct of_device_id *match;
> +
> +	hwmon_device_unregister(data->hwmon_dev);
> +
> +	match = of_match_device(vexpress_hwmon_of_match, &pdev->dev);
> +	sysfs_remove_group(&pdev->dev.kobj, match->data);
> +
> +	vexpress_config_func_put(data->func);
> +
> +	return 0;
> +}
> +
> +static struct platform_driver vexpress_hwmon_driver = {
> +	.probe = vexpress_hwmon_probe,
> +	.remove = __devexit_p(vexpress_hwmon_remove),
> +	.driver	= {
> +		.name = DRVNAME,
> +		.owner = THIS_MODULE,
> +		.of_match_table = vexpress_hwmon_of_match,
> +	},
> +};
> +
> +module_platform_driver(vexpress_hwmon_driver);
> +
> +MODULE_AUTHOR("Pawel Moll <pawel.moll@arm.com>");
> +MODULE_DESCRIPTION("Versatile Express hwmon sensors driver");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:vexpress-hwmon");
> -- 
> 1.7.9.5
> 
> 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

WARNING: multiple messages have this Message-ID (diff)
From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] hwmon: Versatile Express hwmon driver
Date: Fri, 21 Sep 2012 11:18:44 -0700	[thread overview]
Message-ID: <20120921181844.GA20763@roeck-us.net> (raw)
In-Reply-To: <1348246591-2409-1-git-send-email-mail@pawelmoll.com>

On Fri, Sep 21, 2012 at 05:56:31PM +0100, Pawel Moll wrote:
> From: Pawel Moll <pawel.moll@arm.com>
> 
> hwmon framework driver for Versatile Express sensors, providing
> information about board level voltage (only when regulator driver
> is not configured), currents, temperature and power/energy usage.
> Labels for the values can be defined as DT properties.
> 
> Signed-off-by: Pawel Moll <pawel.moll@arm.com>
> ---
>  .../devicetree/bindings/hwmon/vexpress.txt         |   23 ++
>  Documentation/hwmon/vexpress                       |   34 +++
>  drivers/hwmon/Kconfig                              |    8 +
>  drivers/hwmon/Makefile                             |    1 +
>  drivers/hwmon/vexpress.c                           |  229 ++++++++++++++++++++
>  5 files changed, 295 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/vexpress.txt
>  create mode 100644 Documentation/hwmon/vexpress
>  create mode 100644 drivers/hwmon/vexpress.c
> 
[ ... ]

> +
> +	err = sysfs_create_group(&pdev->dev.kobj, match->data);
> +	if (err)
> +		goto error;

You'll need a second label for that. Since the group was not created, you can
not delete it.

> +
> +	data->hwmon_dev = hwmon_device_register(&pdev->dev);
> +	if (IS_ERR(data->hwmon_dev)) {
> +		err = PTR_ERR(data->hwmon_dev);
> +		goto error;
> +	}
> +
> +	return 0;
> +
> +error:
> +	sysfs_remove_group(&pdev->dev.kobj, match->data);
> +	vexpress_config_func_put(data->func);
> +	return err;
> +}
> +
> +static int __devexit vexpress_hwmon_remove(struct platform_device *pdev)
> +{
> +	struct vexpress_hwmon_data *data = platform_get_drvdata(pdev);
> +	const struct of_device_id *match;
> +
> +	hwmon_device_unregister(data->hwmon_dev);
> +
> +	match = of_match_device(vexpress_hwmon_of_match, &pdev->dev);
> +	sysfs_remove_group(&pdev->dev.kobj, match->data);
> +
> +	vexpress_config_func_put(data->func);
> +
> +	return 0;
> +}
> +
> +static struct platform_driver vexpress_hwmon_driver = {
> +	.probe = vexpress_hwmon_probe,
> +	.remove = __devexit_p(vexpress_hwmon_remove),
> +	.driver	= {
> +		.name = DRVNAME,
> +		.owner = THIS_MODULE,
> +		.of_match_table = vexpress_hwmon_of_match,
> +	},
> +};
> +
> +module_platform_driver(vexpress_hwmon_driver);
> +
> +MODULE_AUTHOR("Pawel Moll <pawel.moll@arm.com>");
> +MODULE_DESCRIPTION("Versatile Express hwmon sensors driver");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:vexpress-hwmon");
> -- 
> 1.7.9.5
> 
> 

  reply	other threads:[~2012-09-21 18:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 16:56 [lm-sensors] [PATCH v4] hwmon: Versatile Express hwmon driver Pawel Moll
2012-09-21 16:56 ` Pawel Moll
2012-09-21 18:18 ` Guenter Roeck [this message]
2012-09-21 18:18   ` Guenter Roeck
2012-09-24 12:03   ` [lm-sensors] " Pawel Moll
2012-09-24 12:03     ` Pawel Moll
2012-09-24 12:08     ` [lm-sensors] " Jean Delvare
2012-09-24 12:08       ` Jean Delvare
2012-09-24 12:28       ` [lm-sensors] " Guenter Roeck
2012-09-24 12:28         ` Guenter Roeck
2012-09-24 15:59 ` [lm-sensors] " Guenter Roeck
2012-09-24 15:59   ` Guenter Roeck
2012-09-24 16:09   ` [lm-sensors] " Pawel Moll
2012-09-24 16:09     ` Pawel Moll
2012-09-24 17:18     ` [lm-sensors] " Guenter Roeck
2012-09-24 17:18       ` Guenter Roeck
2012-09-24 17:24       ` [lm-sensors] " Pawel Moll
2012-09-24 17:24         ` Pawel Moll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120921181844.GA20763@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.