Skip to content

Commit

Permalink
mfd: Check for mem_base when building IORESOURCE_MEM resources
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz committed May 27, 2010
1 parent 5f7df57 commit f03cfcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/mfd-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f03cfcb

Please sign in to comment.