return -1;
}
-static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev)
+static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
+ struct device *base_dev)
{
struct generic_pm_domain_data *gpd_data;
- int ret, cpu;
+ int ret;
dev_dbg(dev, "%s()\n", __func__);
if (IS_ERR(gpd_data))
return PTR_ERR(gpd_data);
- cpu = genpd_get_cpu(genpd, dev);
+ gpd_data->cpu = genpd_get_cpu(genpd, base_dev);
ret = genpd->attach_dev ? genpd->attach_dev(genpd, dev) : 0;
if (ret)
genpd_lock(genpd);
- genpd_set_cpumask(genpd, cpu);
+ genpd_set_cpumask(genpd, gpd_data->cpu);
dev_pm_domain_set(dev, &genpd->domain);
genpd->device_count++;
int ret;
mutex_lock(&gpd_list_lock);
- ret = genpd_add_device(genpd, dev);
+ ret = genpd_add_device(genpd, dev, dev);
mutex_unlock(&gpd_list_lock);
return ret;
{
struct generic_pm_domain_data *gpd_data;
struct pm_domain_data *pdd;
- int cpu, ret = 0;
+ int ret = 0;
dev_dbg(dev, "%s()\n", __func__);
pdd = dev->power.subsys_data->domain_data;
gpd_data = to_gpd_data(pdd);
dev_pm_qos_remove_notifier(dev, &gpd_data->nb);
- cpu = genpd_get_cpu(genpd, dev);
genpd_lock(genpd);
genpd->device_count--;
genpd->max_off_time_changed = true;
- genpd_clear_cpumask(genpd, cpu);
+ genpd_clear_cpumask(genpd, gpd_data->cpu);
dev_pm_domain_set(dev, NULL);
list_del_init(&pdd->list_node);
goto out;
}
- ret = genpd_add_device(genpd, dev);
+ ret = genpd_add_device(genpd, dev, dev);
out:
mutex_unlock(&gpd_list_lock);
dev_dbg(dev, "adding to PM domain %s\n", pd->name);
- ret = genpd_add_device(pd, dev);
+ ret = genpd_add_device(pd, dev, base_dev);
mutex_unlock(&gpd_list_lock);
if (ret < 0) {