All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: Fallback to dev_name(map->dev) in case there is no `driver'
@ 2012-07-19  9:31 Dimitris Papastamos
  0 siblings, 0 replies; only message in thread
From: Dimitris Papastamos @ 2012-07-19  9:31 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, patches

This is useful when we want to use regmap with character devices.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 drivers/base/regmap/regmap-debugfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index bb1ff17..c2fbf57 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -39,7 +39,10 @@ static ssize_t regmap_name_read_file(struct file *file,
 	if (!buf)
 		return -ENOMEM;
 
-	ret = snprintf(buf, PAGE_SIZE, "%s\n", map->dev->driver->name);
+	if (map->dev->driver && map->dev->driver->name)
+		ret = snprintf(buf, PAGE_SIZE, "%s\n", map->dev->driver->name);
+	else
+		ret = snprintf(buf, PAGE_SIZE, "%s\n", dev_name(map->dev));
 	if (ret < 0) {
 		kfree(buf);
 		return ret;
-- 
1.7.11.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-19  9:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-19  9:31 [PATCH] regmap: Fallback to dev_name(map->dev) in case there is no `driver' Dimitris Papastamos

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.