summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/iio_hwmon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-15 21:44:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-15 21:44:47 -0700
commitf0718cea471265fe69017191429979ba1a54b9e0 (patch)
tree6ddc525a4229c0106bf0dafae345c3a4d11d2be3 /drivers/hwmon/iio_hwmon.c
parent555f8160b2c36dfa071c043b54d4b1edca7e07b4 (diff)
parent630300d5fcb6ee9c32c75d8b576c100fbb794159 (diff)
downloadlinux-f0718cea471265fe69017191429979ba1a54b9e0.tar.bz2
Merge tag 'hwmon-for-linus-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: - New drivers for NSA320 and LTC2990 - Added support for ADM1278 to adm1275 driver - Added support for ncpXXxh103 to ntc_thermistor driver - Renamed vexpress hwmon implementation - Minor cleanups and improvements * tag 'hwmon-for-linus-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: Create an NSA320 hardware monitoring driver hwmon: Define binding for the nsa320-hwmon driver hwmon: (adm1275) Add support for ADM1278 hwmon: (ntc_thermistor) Add support for ncpXXxh103 Doc: hwmon: Fix typo "montoring" in hwmon ARM: dts: vfxxx: Add iio_hwmon node for ADC temperature channel ARM: dts: Change iio_hwmon nodes to use hypen in node names hwmon: (iio_hwmon) Allow the driver to accept hypen in device tree node names hwmon: Add LTC2990 sensor driver hwmon: (vexpress) rename vexpress hwmon implementation
Diffstat (limited to 'drivers/hwmon/iio_hwmon.c')
-rw-r--r--drivers/hwmon/iio_hwmon.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
index 17ae2eb26ce2..b550ba5fa58a 100644
--- a/drivers/hwmon/iio_hwmon.c
+++ b/drivers/hwmon/iio_hwmon.c
@@ -67,6 +67,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
enum iio_chan_type type;
struct iio_channel *channels;
const char *name = "iio_hwmon";
+ char *sname;
if (dev->of_node && dev->of_node->name)
name = dev->of_node->name;
@@ -144,7 +145,15 @@ static int iio_hwmon_probe(struct platform_device *pdev)
st->attr_group.attrs = st->attrs;
st->groups[0] = &st->attr_group;
- st->hwmon_dev = hwmon_device_register_with_groups(dev, name, st,
+
+ sname = devm_kstrdup(dev, name, GFP_KERNEL);
+ if (!sname) {
+ ret = -ENOMEM;
+ goto error_release_channels;
+ }
+
+ strreplace(sname, '-', '_');
+ st->hwmon_dev = hwmon_device_register_with_groups(dev, sname, st,
st->groups);
if (IS_ERR(st->hwmon_dev)) {
ret = PTR_ERR(st->hwmon_dev);