aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSean Anderson2021-12-15 11:47:17 -0500
committerSean Anderson2022-02-24 23:58:13 -0500
commit6c9239351af7aa3d074c325880b6c265f217cf80 (patch)
tree07d918a7b6d5ebbe883e9be0b2eaee1fd4f81990 /drivers
parente8db644e0d4381b438abf165dd9542393ec9e022 (diff)
clk: cdce9xx: Convert .of_xlate to .request
This xlate function just performs some checking. We can do this in request() instead and use the default xlate. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Tero Kristo <kristo@kernel.org> Link: https://lore.kernel.org/r/20211215164718.2778664-1-seanga2@gmail.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk-cdce9xx.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/clk/clk-cdce9xx.c b/drivers/clk/clk-cdce9xx.c
index 6634b7b7995..f23465d7e1f 100644
--- a/drivers/clk/clk-cdce9xx.c
+++ b/drivers/clk/clk-cdce9xx.c
@@ -86,19 +86,13 @@ static int cdce9xx_reg_write(struct udevice *dev, u8 addr, u8 val)
return ret;
}
-static int cdce9xx_clk_of_xlate(struct clk *clk,
- struct ofnode_phandle_args *args)
+static int cdce9xx_clk_request(struct clk *clk)
{
struct cdce9xx_clk_data *data = dev_get_priv(clk->dev);
- if (args->args_count != 1)
+ if (clk->id > data->chip->num_outputs)
return -EINVAL;
- if (args->args[0] > data->chip->num_outputs)
- return -EINVAL;
-
- clk->id = args->args[0];
-
return 0;
}
@@ -241,7 +235,7 @@ static const struct udevice_id cdce9xx_clk_of_match[] = {
};
static const struct clk_ops cdce9xx_clk_ops = {
- .of_xlate = cdce9xx_clk_of_xlate,
+ .request = cdce9xx_clk_request,
.get_rate = cdce9xx_clk_get_rate,
.set_rate = cdce9xx_clk_set_rate,
};