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>
This commit is contained in:
Samuel Ortiz 2010-03-26 01:09:04 +01:00
parent 5f7df57eec
commit f03cfcbc84
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ static int mfd_add_device(struct device *parent, int id,
res[r].flags = cell->resources[r].flags; res[r].flags = cell->resources[r].flags;
/* Find out base to use */ /* 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].parent = mem_base;
res[r].start = mem_base->start + res[r].start = mem_base->start +
cell->resources[r].start; cell->resources[r].start;