aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/mfd-core.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-03-26 01:09:04 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-05-28 01:37:31 +0200
commitf03cfcbc843ae6854c69dbc771762b83b3bea15f (patch)
treed65ef52e0a23ebeb6875738695cf7b0196735f09 /drivers/mfd/mfd-core.c
parent5f7df57eeca93fc931b32e7723fe8f964aaa63df (diff)
mfd: Check for mem_base when building IORESOURCE_MEM resources
If mem_base is NULL, then we fall back to the default case, just copying the original resource. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/mfd-core.c')
-rw-r--r--drivers/mfd/mfd-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 8ffbb7a85a7..7dd76bceaae 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -48,7 +48,7 @@ static int mfd_add_device(struct device *parent, int id,
res[r].flags = cell->resources[r].flags;
/* Find out base to use */
- if (cell->resources[r].flags & IORESOURCE_MEM) {
+ if ((cell->resources[r].flags & IORESOURCE_MEM) && mem_base) {
res[r].parent = mem_base;
res[r].start = mem_base->start +
cell->resources[r].start;