Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363643
b: refs/heads/master
c: 3465a22
h: refs/heads/master
i:
  363641: b4f2d05
  363639: 778fa24
v: v3
  • Loading branch information
Guenter Roeck authored and Jonathan Cameron committed Mar 20, 2013
1 parent 5905afd commit fb6cc90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb916ebbeabd18f7dc3c661275d2c9d343f4fa85
refs/heads/master: 3465a22488a47d5f4791876a22fde2bb1720f4cf
8 changes: 7 additions & 1 deletion trunk/drivers/staging/iio/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/of.h>
#include <linux/hwmon-sysfs.h>
#include <linux/iio/consumer.h>
#include <linux/iio/types.h>
Expand Down Expand Up @@ -58,7 +59,12 @@ static ssize_t iio_hwmon_read_val(struct device *dev,
static ssize_t show_name(struct device *dev, struct device_attribute *attr,
char *buf)
{
return sprintf(buf, "iio_hwmon\n");
const char *name = "iio_hwmon";

if (dev->of_node && dev->of_node->name)
name = dev->of_node->name;

return sprintf(buf, "%s\n", name);
}

static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
Expand Down

0 comments on commit fb6cc90

Please sign in to comment.