From: pawel.moll@arm.com (Pawel Moll)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/10] hwmon: vexpress: Use devm helper for hwmon device registration
Date: Wed, 30 Apr 2014 16:16:19 +0100 [thread overview]
Message-ID: <1398870979.24255.37.camel@hornet> (raw)
In-Reply-To: <535EDD49.8050107@roeck-us.net>
On Mon, 2014-04-28 at 23:59 +0100, Guenter Roeck wrote:
> On 04/28/2014 10:uct attribute_group **attr_groups;
> > @@ -114,10 +95,13 @@ struct vexpress_hwmon_type {
> > static DEVICE_ATTR(in1_label, S_IRUGO, vexpress_hwmon_label_show, NULL);
> > static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, vexpress_hwmon_u32_show,
> > NULL, 1000);
> > -static VEXPRESS_HWMON_ATTRS(volt, in1_label, in1_input);
> > static struct attribute_group vexpress_hwmon_group_volt = {
> > .is_visible = vexpress_hwmon_attr_is_visible,
> > - .attrs = vexpress_hwmon_attrs_volt,
> > + .attrs = (struct attribute *[]) {
>
> Is this typecast necessary ?
Yes, it's the gcc extension that allows compound literals to be used for
static structure members initialization. I like it, because it makes
them easier to understand (in my opinion, that is), but if you prefer
the classic approach, I'll unroll VEXPRESS_HWMON_ATTRS into:
static struct attribute vexpress_hwmon_attrs_volt = {
&dev_attr_in1_label.attr,
&sensor_dev_attr_in1_input.dev_attr.attr,
NULL
};
And keep
static struct attribute_group vexpress_hwmon_group_volt = {
.is_visible = vexpress_hwmon_attr_is_visible,
.attrs = vexpress_hwmon_attrs_volt,
};
> > @@ -232,45 +227,19 @@ static int vexpress_hwmon_probe(struct platform_device *pdev)
> > if (!match)
> > return -ENODEV;
> > type = match->data;
> > - data->name = type->name;
> >
> > data->reg = devm_regmap_init_vexpress_config(&pdev->dev);
> > - if (!data->reg)
> > - return -ENODEV;
> > -
> > - err = sysfs_create_groups(&pdev->dev.kobj, type->attr_groups);
> > - if (err)
> > - goto error;
> > -
> > - data->hwmon_dev = hwmon_device_register(&pdev->dev);
> > - if (IS_ERR(data->hwmon_dev)) {
> > - err = PTR_ERR(data->hwmon_dev);
> > - goto error;
> > - }
> > + if (IS_ERR(data->reg))
> > + return PTR_ERR(data->reg);
>
> Did the API for devm_regmap_init_vexpress_config change ?
> If so, it might make sense to separate this out into a separate patch,
> together with the API change (it is a logically different change).
I'm not sure I understand the question. The other patch from the series
I've copied you on
(http://article.gmane.org/gmane.linux.ports.arm.kernel/320577 "[PATCH
02/10] mfd: vexpress: Convert custom func API to regmap") changes
- data->func = vexpress_config_func_get_by_dev(&pdev->dev);
into
+ data->reg = devm_regmap_init_vexpress_config(&pdev->dev);
Your ack there, by the way, will be really appreciated :-)
> One question - I seem to be unable to apply the patch. What is your
> baseline branch / repository ?
The whole series, based on v3.15-rc3 lives here:
git://git.linaro.org/people/pawel.moll/linux.git vexpress/sysreg
Pawel
next prev parent reply other threads:[~2014-04-30 15:16 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 17:57 [PATCH 00/10] Versatile Express changes for 3.16 Pawel Moll
2014-04-28 17:57 ` [PATCH 01/10] of: Keep track of populated platform devices Pawel Moll
2014-04-28 18:02 ` Rob Herring
2014-04-29 12:56 ` Grant Likely
2014-04-30 11:48 ` Pawel Moll
2014-04-30 14:05 ` [PATCH v2] " Pawel Moll
2014-04-30 15:22 ` Rob Herring
2014-05-01 9:26 ` Grant Likely
2014-05-01 9:43 ` Grant Likely
2014-05-07 14:37 ` Pawel Moll
2014-05-14 10:56 ` Grant Likely
2014-05-15 15:08 ` Pawel Moll
2014-04-28 17:57 ` [PATCH 02/10] mfd: vexpress: Convert custom func API to regmap Pawel Moll
2014-04-29 22:21 ` Mark Brown
2014-04-30 13:58 ` Lee Jones
2014-04-30 14:13 ` Pawel Moll
2014-04-30 14:29 ` Lee Jones
2014-04-30 14:38 ` Pawel Moll
2014-04-30 16:01 ` [PATCH v2] " Pawel Moll
2014-04-30 17:05 ` Guenter Roeck
2014-05-01 18:58 ` Mike Turquette
2014-04-28 17:57 ` [PATCH 03/10] mfd: syscon: Add platform data with a regmap config name Pawel Moll
2014-04-28 17:57 ` [PATCH 04/10] mfd: vexpress: Define the device as MFD cells Pawel Moll
2014-05-09 11:24 ` Lee Jones
2014-04-28 17:57 ` [PATCH 05/10] clk: versatile: Split config options for sp810 and vexpress_osc Pawel Moll
2014-05-01 18:55 ` Mike Turquette
2014-04-28 17:57 ` [PATCH 06/10] clocksource: Sched clock source for Versatile Express Pawel Moll
2014-04-28 17:57 ` [PATCH 07/10] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Pawel Moll
2014-04-28 17:57 ` [PATCH 08/10] ARM: vexpress: Simplify SMP operations for DT-powered system Pawel Moll
2014-04-28 17:57 ` [PATCH 09/10] ARM: vexpress: move HBI check to sysreg driver Pawel Moll
2014-04-30 14:02 ` Lee Jones
2014-04-28 17:57 ` [PATCH 10/10] hwmon: vexpress: Use devm helper for hwmon device registration Pawel Moll
2014-04-28 22:59 ` Guenter Roeck
2014-04-30 15:16 ` Pawel Moll [this message]
2014-04-30 15:27 ` Guenter Roeck
2014-04-30 15:33 ` Pawel Moll
[not found] <Message-ID: <1399473437.3706.25.camel@hornet>
2014-05-13 11:48 ` [PATCH v3] of: Keep track of populated platform devices Pawel Moll
2014-05-13 12:24 ` Rob Herring
2014-05-14 11:05 ` Grant Likely
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=1398870979.24255.37.camel@hornet \
--to=pawel.moll@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).