|
@@ -1462,7 +1462,7 @@ static struct regulator_dev *regulator_lookup_by_name(const char *name)
|
|
static struct regulator_dev *regulator_dev_lookup(struct device *dev,
|
|
static struct regulator_dev *regulator_dev_lookup(struct device *dev,
|
|
const char *supply)
|
|
const char *supply)
|
|
{
|
|
{
|
|
- struct regulator_dev *r;
|
|
|
|
|
|
+ struct regulator_dev *r = NULL;
|
|
struct device_node *node;
|
|
struct device_node *node;
|
|
struct regulator_map *map;
|
|
struct regulator_map *map;
|
|
const char *devname = NULL;
|
|
const char *devname = NULL;
|
|
@@ -1489,10 +1489,6 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
|
|
if (dev)
|
|
if (dev)
|
|
devname = dev_name(dev);
|
|
devname = dev_name(dev);
|
|
|
|
|
|
- r = regulator_lookup_by_name(supply);
|
|
|
|
- if (r)
|
|
|
|
- return r;
|
|
|
|
-
|
|
|
|
mutex_lock(®ulator_list_mutex);
|
|
mutex_lock(®ulator_list_mutex);
|
|
list_for_each_entry(map, ®ulator_map_list, list) {
|
|
list_for_each_entry(map, ®ulator_map_list, list) {
|
|
/* If the mapping has a device set up it must match */
|
|
/* If the mapping has a device set up it must match */
|
|
@@ -1508,6 +1504,10 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
|
|
}
|
|
}
|
|
mutex_unlock(®ulator_list_mutex);
|
|
mutex_unlock(®ulator_list_mutex);
|
|
|
|
|
|
|
|
+ if (r)
|
|
|
|
+ return r;
|
|
|
|
+
|
|
|
|
+ r = regulator_lookup_by_name(supply);
|
|
if (r)
|
|
if (r)
|
|
return r;
|
|
return r;
|
|
|
|
|