Commit df5a6965 authored by Peng Fan's avatar Peng Fan Committed by Shawn Guo

soc: imx: imx8m-blk-ctrl: Use genpd_xlate_onecell

Simplify driver by using genpd_xlate_onecell instead of
driver specific xlate function.
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 5506018d
...@@ -162,19 +162,6 @@ static int imx8m_blk_ctrl_power_off(struct generic_pm_domain *genpd) ...@@ -162,19 +162,6 @@ static int imx8m_blk_ctrl_power_off(struct generic_pm_domain *genpd)
return 0; return 0;
} }
static struct generic_pm_domain *
imx8m_blk_ctrl_xlate(struct of_phandle_args *args, void *data)
{
struct genpd_onecell_data *onecell_data = data;
unsigned int index = args->args[0];
if (args->args_count != 1 ||
index >= onecell_data->num_domains)
return ERR_PTR(-EINVAL);
return onecell_data->domains[index];
}
static struct lock_class_key blk_ctrl_genpd_lock_class; static struct lock_class_key blk_ctrl_genpd_lock_class;
static int imx8m_blk_ctrl_probe(struct platform_device *pdev) static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
...@@ -216,7 +203,6 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev) ...@@ -216,7 +203,6 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
bc->onecell_data.num_domains = bc_data->num_domains; bc->onecell_data.num_domains = bc_data->num_domains;
bc->onecell_data.xlate = imx8m_blk_ctrl_xlate;
bc->onecell_data.domains = bc->onecell_data.domains =
devm_kcalloc(dev, bc_data->num_domains, devm_kcalloc(dev, bc_data->num_domains,
sizeof(struct generic_pm_domain *), GFP_KERNEL); sizeof(struct generic_pm_domain *), GFP_KERNEL);
......
...@@ -490,19 +490,6 @@ static int imx8mp_blk_ctrl_power_off(struct generic_pm_domain *genpd) ...@@ -490,19 +490,6 @@ static int imx8mp_blk_ctrl_power_off(struct generic_pm_domain *genpd)
return 0; return 0;
} }
static struct generic_pm_domain *
imx8m_blk_ctrl_xlate(struct of_phandle_args *args, void *data)
{
struct genpd_onecell_data *onecell_data = data;
unsigned int index = args->args[0];
if (args->args_count != 1 ||
index >= onecell_data->num_domains)
return ERR_PTR(-EINVAL);
return onecell_data->domains[index];
}
static struct lock_class_key blk_ctrl_genpd_lock_class; static struct lock_class_key blk_ctrl_genpd_lock_class;
static int imx8mp_blk_ctrl_probe(struct platform_device *pdev) static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
...@@ -545,7 +532,6 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev) ...@@ -545,7 +532,6 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
bc->onecell_data.num_domains = num_domains; bc->onecell_data.num_domains = num_domains;
bc->onecell_data.xlate = imx8m_blk_ctrl_xlate;
bc->onecell_data.domains = bc->onecell_data.domains =
devm_kcalloc(dev, num_domains, devm_kcalloc(dev, num_domains,
sizeof(struct generic_pm_domain *), GFP_KERNEL); sizeof(struct generic_pm_domain *), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment