All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 09/12] hwmon: vexpress: Use devm helper for hwmon device registration
  2014-02-11 17:10   ` Pawel Moll
@ 2014-02-12  2:49 ` Guenter Roeck
  -1 siblings, 0 replies; 112+ messages in thread
From: Guenter Roeck @ 2014-02-12  2:49 UTC (permalink / raw)
  To: Pawel Moll; +Cc: arm, linux-arm-kernel, linux-kernel, Jean Delvare, lm-sensors

On Tue, Feb 11, 2014 at 05:10:33PM +0000, Pawel Moll wrote:
> Use devm_hwmon_device_register_with_groups instead of
> the old-style manual attributes and hwmon device registration.
> 

[ ... ]

>  static int vexpress_hwmon_probe(struct platform_device *pdev)
>  {
> -	int err;
>  	const struct of_device_id *match;
>  	struct vexpress_hwmon_data *data;
> +	const char *name;
> +	const struct attribute_group **groups;
>  
>  	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
>  	if (!data)
> @@ -176,42 +151,19 @@ static int vexpress_hwmon_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  

There is a leftover platform_set_drvdata() above which you can remove;
attributes are now attached to the hwmon device and no longer
to the platform device.

>  
> -	match = of_match_device(vexpress_hwmon_of_match, &pdev->dev);
> -	sysfs_remove_group(&pdev->dev.kobj, match->data);
> +	name = of_get_property(pdev->dev.of_node, "compatible", NULL);

Couple of problems, two of which escaped me earlier.

First, can of_get_property ever return NULL ? I think not, just wondering.

Second is a real problem. You have a '-' in the compatible property which is
illegal for the 'name' attribute in hwmon devices. It messes up libsensors
and thus every application using it. Not sure what a good fix (or name)
would be; simplest might be to copy the name string and replace it with '_'.
Sorry for not noticing this earlier; it might actually make sense to submit
a separate patch to address this so we can apply it to the current kernel
and if necessary patch it into earlier kernels.

Third, I noticed that the 'label' attribute is always created but returns  
-ENOENT if there is no label. A much better implementation would be to use
.is_visible and not create the label attribute if its devicetree entry
does not exist. I don't know how libsensors reacts to -ENOENT on a read,
but no matter how it does react, it is pretty much undefined.
Again, that should be handled in a separate patch.

I agree with Arnd that it would be nice to get rid of the local macro,
but I won't mandate that.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 112+ messages in thread
* [PATCH 00/12] Versatile Express updates
@ 2014-02-11 17:10 ` Pawel Moll
  0 siblings, 0 replies; 112+ messages in thread
From: Pawel Moll @ 2014-02-11 17:10 UTC (permalink / raw)
  To: arm, linux-arm-kernel, linux-kernel
  Cc: Pawel Moll, Arnd Bergmann, Greg Kroah-Hartman,
	Dmitry Eremin-Solenikov, David Woodhouse, Mike Turquette,
	Daniel Lezcano, Thomas Gleixner, Linus Walleij,
	Alexandre Courbot, Samuel Ortiz, Lee Jones, Jean Delvare,
	Guenter Roeck, lm-sensors

This series is a set of updates following the infrastructure
rework and depends on it. It will be finally posted once
the main series is merged. For the time being I would really
appreciate feedback and/or (n)acks...

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Guenter Roeck <linux@roeck-us.net> 
Cc: lm-sensors@lm-sensors.org

Pawel Moll (11):
  misc: vexpress-syscfg: Add udelay-based delay
  power/reset: vexpress: Use udelay instead of timers
  clk: versatile: Split config options for sp810 and vexpress_osc
  clocksource: Sched clock source for Versatile Express
  GPIO: gpio-generic: Add label to platform data
  mfd: vexpress-sysreg: Add labels to gpio banks
  mfd: syscon: Consider platform data a regmap config name
  mfd: vexpress-sysreg: Add syscon labels as platform data
  hwmon: vexpress: Use devm helper for hwmon device registration
  ARM: vexpress: Simplify SMP operations for DT-powered system
  ARM: vexpress: move HBI check to sysreg driver

Sudeep KarkadaNagesha (1):
  ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count

 arch/arm/mach-vexpress/core.h           |   3 +-
 arch/arm/mach-vexpress/platsmp.c        | 187 +++++++-------------------------
 arch/arm/mach-vexpress/v2m.c            |  57 +---------
 drivers/clk/Kconfig                     |   9 +-
 drivers/clk/versatile/Kconfig           |  26 +++++
 drivers/clk/versatile/Makefile          |   5 +-
 drivers/clocksource/Kconfig             |   9 ++
 drivers/clocksource/Makefile            |   1 +
 drivers/clocksource/vexpress.c          |  40 +++++++
 drivers/gpio/gpio-generic.c             |   2 +
 drivers/hwmon/vexpress.c                | 100 +++++------------
 drivers/mfd/syscon.c                    |   1 +
 drivers/mfd/vexpress-sysreg.c           |  45 ++++----
 drivers/misc/vexpress-syscfg.c          |  40 ++++++-
 drivers/power/reset/vexpress-poweroff.c |  10 +-
 include/linux/basic_mmio_gpio.h         |   1 +
 include/linux/vexpress.h                |   1 -
 17 files changed, 216 insertions(+), 321 deletions(-)
 create mode 100644 drivers/clk/versatile/Kconfig
 create mode 100644 drivers/clocksource/vexpress.c

-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 112+ messages in thread

end of thread, other threads:[~2014-05-13  8:47 UTC | newest]

Thread overview: 112+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12  2:49 [PATCH 09/12] hwmon: vexpress: Use devm helper for hwmon device registration Guenter Roeck
2014-02-12  2:49 ` [lm-sensors] " Guenter Roeck
2014-02-12 11:56 ` Pawel Moll
2014-02-12 11:56   ` [lm-sensors] " Pawel Moll
2014-02-12 11:56   ` Pawel Moll
2014-02-12 11:59   ` Pawel Moll
2014-02-12 11:59     ` [lm-sensors] " Pawel Moll
2014-02-12 11:59     ` Pawel Moll
2014-02-12 16:41   ` Guenter Roeck
2014-02-12 16:41     ` [lm-sensors] " Guenter Roeck
2014-02-12 16:41     ` Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2014-02-11 17:10 [PATCH 00/12] Versatile Express updates Pawel Moll
2014-02-11 17:10 ` [lm-sensors] " Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 01/12] misc: vexpress-syscfg: Add udelay-based delay Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-15 19:19   ` Greg Kroah-Hartman
2014-02-15 19:19     ` Greg Kroah-Hartman
2014-02-11 17:10 ` [PATCH 02/12] power/reset: vexpress: Use udelay instead of timers Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 20:59   ` Arnd Bergmann
2014-02-11 20:59     ` Arnd Bergmann
2014-02-12 11:56     ` Pawel Moll
2014-02-12 11:56       ` Pawel Moll
2014-02-11 17:10 ` [PATCH 03/12] clk: versatile: Split config options for sp810 and vexpress_osc Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 17:10 ` [PATCH 04/12] clocksource: Sched clock source for Versatile Express Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-04-16 13:56   ` Rob Herring
2014-04-16 13:56     ` Rob Herring
2014-04-16 14:22     ` Pawel Moll
2014-04-16 14:22       ` Pawel Moll
2014-04-16 14:45       ` Rob Herring
2014-04-16 14:45         ` Rob Herring
2014-04-16 15:05         ` Pawel Moll
2014-04-16 15:05           ` Pawel Moll
2014-05-02 22:14   ` Linus Walleij
2014-05-02 22:14     ` Linus Walleij
2014-05-07  9:57     ` Pawel Moll
2014-05-07  9:57       ` Pawel Moll
2014-05-13  8:47       ` Linus Walleij
2014-05-13  8:47         ` Linus Walleij
2014-02-11 17:10 ` [PATCH 05/12] GPIO: gpio-generic: Add label to platform data Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 17:17   ` Lee Jones
2014-02-11 17:17     ` Lee Jones
2014-02-11 17:20     ` Pawel Moll
2014-02-11 17:20       ` Pawel Moll
2014-02-11 17:29       ` Pawel Moll
2014-02-11 17:29         ` Pawel Moll
2014-02-11 17:46       ` Lee Jones
2014-02-11 17:46         ` Lee Jones
2014-02-11 17:10 ` [PATCH 06/12] mfd: vexpress-sysreg: Add labels to gpio banks Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 17:19   ` Lee Jones
2014-02-11 17:19     ` Lee Jones
2014-02-13 13:08   ` Linus Walleij
2014-02-13 13:08     ` Linus Walleij
2014-02-13 13:11     ` Pawel Moll
2014-02-13 13:11       ` Pawel Moll
2014-02-11 17:10 ` [PATCH 07/12] mfd: syscon: Consider platform data a regmap config name Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 17:24   ` Lee Jones
2014-02-11 17:24     ` Lee Jones
2014-02-12  7:09   ` Alexander Shiyan
2014-02-12  7:09     ` Alexander Shiyan
2014-02-12  8:26     ` Lee Jones
2014-02-12  8:26       ` Lee Jones
2014-02-12 11:06       ` Pawel Moll
2014-02-12 11:06         ` Pawel Moll
2014-02-12 11:18         ` Lee Jones
2014-02-12 11:18           ` Lee Jones
2014-02-12 11:27         ` Alexander Shiyan
2014-02-12 11:27           ` Alexander Shiyan
2014-02-12 11:43           ` Pawel Moll
2014-02-12 11:43             ` Pawel Moll
2014-02-11 17:10 ` [PATCH 08/12] mfd: vexpress-sysreg: Add syscon labels as platform data Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 17:29   ` Lee Jones
2014-02-11 17:29     ` Lee Jones
2014-02-11 17:32     ` Pawel Moll
2014-02-11 17:32       ` Pawel Moll
2014-02-11 17:48       ` Lee Jones
2014-02-11 17:48         ` Lee Jones
2014-02-11 17:52         ` [PATCH v2 1/2] mfd: syscon: Add platform data with a regmap config name Pawel Moll
2014-02-11 17:52           ` Pawel Moll
2014-02-11 17:52           ` [PATCH v2 2/2] mfd: vexpress-sysreg: Add syscon labels as platform data Pawel Moll
2014-02-11 17:52             ` Pawel Moll
2014-02-12 11:20             ` Lee Jones
2014-02-12 11:20               ` Lee Jones
2014-02-11 17:55           ` [PATCH v2 1/2] mfd: syscon: Add platform data with a regmap config name Pawel Moll
2014-02-11 17:55             ` Pawel Moll
2014-02-12 11:19           ` Lee Jones
2014-02-12 11:19             ` Lee Jones
2014-02-11 17:10 ` [PATCH 09/12] hwmon: vexpress: Use devm helper for hwmon device registration Pawel Moll
2014-02-11 17:10   ` [lm-sensors] " Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 20:57   ` Arnd Bergmann
2014-02-11 20:57     ` [lm-sensors] " Arnd Bergmann
2014-02-11 20:57     ` Arnd Bergmann
2014-02-11 17:10 ` [PATCH 10/12] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 17:10 ` [PATCH 11/12] ARM: vexpress: Simplify SMP operations for DT-powered system Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 17:10 ` [PATCH 12/12] ARM: vexpress: move HBI check to sysreg driver Pawel Moll
2014-02-11 17:10   ` Pawel Moll
2014-02-11 19:28 ` [PATCH 00/12] Versatile Express updates Arnd Bergmann
2014-02-11 19:28   ` [lm-sensors] " Arnd Bergmann
2014-02-11 19:28   ` Arnd Bergmann
2014-02-12 12:30   ` Pawel Moll
2014-02-12 12:30     ` [lm-sensors] " Pawel Moll
2014-02-12 12:30     ` Pawel Moll

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.