mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
Merge remote-tracking branch 'regulator/topic/core' into regulator-next
This commit is contained in:
commit
fcaa3167b2
1 changed files with 18 additions and 28 deletions
|
@ -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;
|
||||||
|
|
||||||
|
@ -4312,41 +4312,31 @@ void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data)
|
||||||
EXPORT_SYMBOL_GPL(regulator_get_init_drvdata);
|
EXPORT_SYMBOL_GPL(regulator_get_init_drvdata);
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
static ssize_t supply_map_read_file(struct file *file, char __user *user_buf,
|
static int supply_map_show(struct seq_file *sf, void *data)
|
||||||
size_t count, loff_t *ppos)
|
|
||||||
{
|
{
|
||||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
|
||||||
ssize_t len, ret = 0;
|
|
||||||
struct regulator_map *map;
|
struct regulator_map *map;
|
||||||
|
|
||||||
if (!buf)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
list_for_each_entry(map, ®ulator_map_list, list) {
|
list_for_each_entry(map, ®ulator_map_list, list) {
|
||||||
len = snprintf(buf + ret, PAGE_SIZE - ret,
|
seq_printf(sf, "%s -> %s.%s\n",
|
||||||
"%s -> %s.%s\n",
|
rdev_get_name(map->regulator), map->dev_name,
|
||||||
rdev_get_name(map->regulator), map->dev_name,
|
map->supply);
|
||||||
map->supply);
|
|
||||||
if (len >= 0)
|
|
||||||
ret += len;
|
|
||||||
if (ret > PAGE_SIZE) {
|
|
||||||
ret = PAGE_SIZE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
kfree(buf);
|
static int supply_map_open(struct inode *inode, struct file *file)
|
||||||
|
{
|
||||||
return ret;
|
return single_open(file, supply_map_show, inode->i_private);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const struct file_operations supply_map_fops = {
|
static const struct file_operations supply_map_fops = {
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
.read = supply_map_read_file,
|
.open = supply_map_open,
|
||||||
.llseek = default_llseek,
|
.read = seq_read,
|
||||||
|
.llseek = seq_lseek,
|
||||||
|
.release = single_release,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue