Skip to content

Commit df5a696

Browse files
MrVanShawn Guo
authored andcommitted
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: Peng Fan <peng.fan@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
1 parent 5506018 commit df5a696

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

drivers/soc/imx/imx8m-blk-ctrl.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,6 @@ static int imx8m_blk_ctrl_power_off(struct generic_pm_domain *genpd)
162162
return 0;
163163
}
164164

165-
static struct generic_pm_domain *
166-
imx8m_blk_ctrl_xlate(struct of_phandle_args *args, void *data)
167-
{
168-
struct genpd_onecell_data *onecell_data = data;
169-
unsigned int index = args->args[0];
170-
171-
if (args->args_count != 1 ||
172-
index >= onecell_data->num_domains)
173-
return ERR_PTR(-EINVAL);
174-
175-
return onecell_data->domains[index];
176-
}
177-
178165
static struct lock_class_key blk_ctrl_genpd_lock_class;
179166

180167
static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
@@ -216,7 +203,6 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
216203
return -ENOMEM;
217204

218205
bc->onecell_data.num_domains = bc_data->num_domains;
219-
bc->onecell_data.xlate = imx8m_blk_ctrl_xlate;
220206
bc->onecell_data.domains =
221207
devm_kcalloc(dev, bc_data->num_domains,
222208
sizeof(struct generic_pm_domain *), GFP_KERNEL);

drivers/soc/imx/imx8mp-blk-ctrl.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -490,19 +490,6 @@ static int imx8mp_blk_ctrl_power_off(struct generic_pm_domain *genpd)
490490
return 0;
491491
}
492492

493-
static struct generic_pm_domain *
494-
imx8m_blk_ctrl_xlate(struct of_phandle_args *args, void *data)
495-
{
496-
struct genpd_onecell_data *onecell_data = data;
497-
unsigned int index = args->args[0];
498-
499-
if (args->args_count != 1 ||
500-
index >= onecell_data->num_domains)
501-
return ERR_PTR(-EINVAL);
502-
503-
return onecell_data->domains[index];
504-
}
505-
506493
static struct lock_class_key blk_ctrl_genpd_lock_class;
507494

508495
static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
@@ -545,7 +532,6 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
545532
return -ENOMEM;
546533

547534
bc->onecell_data.num_domains = num_domains;
548-
bc->onecell_data.xlate = imx8m_blk_ctrl_xlate;
549535
bc->onecell_data.domains =
550536
devm_kcalloc(dev, num_domains,
551537
sizeof(struct generic_pm_domain *), GFP_KERNEL);

0 commit comments

Comments
 (0)