aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-05-23 10:23:21 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-23 10:24:14 -0400
commitca2cad6ae38ea0ff27a7a7a00bfaa571fbe9051f (patch)
tree24911bc764dc4956401178ff4fac7d0cef2cf628 /drivers
parent78302a194c0ddf4438e50e3f9b327a6dce6bc8fc (diff)
mfd: Fix twl6040 build failure
Without it we get: CC drivers/mfd/twl6040-core.o drivers/mfd/twl6040-core.c: In function ‘twl6040_has_vibra’: drivers/mfd/twl6040-core.c:55:2: error: implicit declaration of function ‘of_find_node_by_name’ [-Werror=implicit-function-declaration] Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/twl6040-core.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index 450a28fe8fc2..4ded9e7aa246 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -45,6 +45,20 @@
45#define VIBRACTRL_MEMBER(reg) ((reg == TWL6040_REG_VIBCTLL) ? 0 : 1) 45#define VIBRACTRL_MEMBER(reg) ((reg == TWL6040_REG_VIBCTLL) ? 0 : 1)
46#define TWL6040_NUM_SUPPLIES (2) 46#define TWL6040_NUM_SUPPLIES (2)
47 47
48static bool twl6040_has_vibra(struct twl6040_platform_data *pdata,
49 struct device_node *node)
50{
51 if (pdata && pdata->vibra)
52 return true;
53
54#ifdef CONFIG_OF
55 if (of_find_node_by_name(node, "vibra"))
56 return true;
57#endif
58
59 return false;
60}
61
48int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) 62int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
49{ 63{
50 int ret; 64 int ret;
@@ -617,7 +631,7 @@ static int __devinit twl6040_probe(struct i2c_client *client,
617 } 631 }
618 children++; 632 children++;
619 633
620 if ((pdata && pdata->vibra) || of_find_node_by_name(node, "vibra")) { 634 if (twl6040_has_vibra(pdata, node)) {
621 irq = twl6040->irq_base + TWL6040_IRQ_VIB; 635 irq = twl6040->irq_base + TWL6040_IRQ_VIB;
622 636
623 cell = &twl6040->cells[children]; 637 cell = &twl6040->cells[children];