clk: cdce9xx: Convert .of_xlate to .request
PATCH 1/2 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.
---
drivers/clk/clk-cdce9xx.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/clk/clk-cdce9xx.c +3 -9
@@ -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_of_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, };
Signature · 1 line
2.33.0
PATCH 2/2 clk: cdce9xxx: Add maintainer
This adds an entry in MAINTAINERS for the cdce9xx driver, since it was not added when the driver was submitted.
---
Tero, if you don't want to maintain this I'll resubmit this patch with the orphaned status. Alternatively, perhaps Tom wants to maintain this driver since it is used exclusively by boards he maintains.
MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
@@ -658,6 +658,12 @@ M: Simon Glass <[email protected]> S: Maintained F: tools/buildman/ +CDCE9XX CLOCK: +M: Tero Kristo <[email protected]> +S: Maintained +F: doc/device-tree-bindings/clock/ti,cdce9xx.txt +F: drivers/clk/clk-cdce9xx.c + CFI FLASH M: Stefan Roese <[email protected]> S: Maintained
Signature · 1 line
2.33.0
Re: [PATCH 2/2] clk: cdce9xxx: Add maintainer
Quoted 8 lines · Sean Anderson
This adds an entry in
MAINTAINERSfor the cdce9xx driver, since it was not added when the driver was submitted.Signed-off-by Sean Anderson <[email protected]>---
Tero, if you don't want to maintain this I'll resubmit this patch with the orphaned status. Alternatively, perhaps Tom wants to maintain this driver since it is used exclusively by boards he maintains.
Well, it looks like Tero's email bounced, so it will have to be either Tom or orphaned.
--Sean
Quoted 36 lines · Sean Anderson
This xlate function just performs some checking. We can do this in
request()instead and use the default xlate.Signed-off-by Sean Anderson <[email protected]>---
drivers/clk/clk-cdce9xx.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)drivers/clk/clk-cdce9xx.c +2
-8@@ -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_of_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 ; }
drivers/clk/clk-cdce9xx.c static const struct udevice_id cdce9xx_clk_of_match[] = { · line 241
Quoted 8 lines
drivers/clk/clk-cdce9xx.c +1
-1@@ -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, };
Adding Tero...
Signature · 1 line
Tom
Quoted 40 lines · Tom Rini
Quoted 38 lines · Sean Anderson
This xlate function just performs some checking. We can do this in
request()instead and use the default xlate.Signed-off-by Sean Anderson <[email protected]>---
drivers/clk/clk-cdce9xx.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)drivers/clk/clk-cdce9xx.c +2
-8@@ -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_of_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[] = { };
Quoted 9 lines
drivers/clk/clk-cdce9xx.c static const struct udevice_id cdce9xx_clk_of_match[] = { · line 241
Quoted 6 lines
drivers/clk/clk-cdce9xx.c +1
-1static 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, };Adding Tero...
Thanks. Perhaps .mailmap should be updated?
--Sean
Quoted 7 lines · Sean Anderson
Quoted 6 lines · Tom Rini
Quoted 4 lines · Sean Anderson
This xlate function just performs some checking. We can do this in
request()instead and use the default xlate.Signed-off-by Sean Anderson <[email protected]>
Hi Sean,
Did you compile this? I see...
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
---
drivers/clk/clk-cdce9xx.c| 12 +++---------1 file changed, 3 insertions(+), 9 deletions(-)
Quoted 11 lines
Quoted 11 lines
drivers/clk/clk-cdce9xx.c static int cdce9xx_reg_write(struct udevice *dev, · line 89
Quoted 11 lines
drivers/clk/clk-cdce9xx.c +1
-2@@ -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_of_request (struct clk *clk)
cdce9xx_clk_of_request here...
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
drivers/clk/clk-cdce9xx.c +1
-6{ 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]; -
Quoted 8 lines
Quoted 8 lines
drivers/clk/clk-cdce9xx.c static const struct udevice_id · line 238
Quoted 8 lines
drivers/clk/clk-cdce9xx.c +1
-1return 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,
but cdce9xx_clk_request here.
Other than that, looks fine to me.
-Tero
Quoted 10 lines
Quoted 6 lines
drivers/clk/clk-cdce9xx.c static const struct udevice_id cdce9xx_clk_of_match[] = { · line 241
Quoted 3 lines
drivers/clk/clk-cdce9xx.c +0
-0.get_rate = cdce9xx_clk_get_rate, .set_rate = cdce9xx_clk_set_rate, };Adding Tero...
Thanks. Perhaps .mailmap should be updated?
--Sean
Quoted 51 lines · Tero Kristo
Quoted 7 lines · Sean Anderson
Quoted 6 lines · Tom Rini
Quoted 4 lines · Sean Anderson
This xlate function just performs some checking. We can do this in
request()instead and use the default xlate.Signed-off-by Sean Anderson <[email protected]>Hi Sean,
Did you compile this? I see...
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
---
drivers/clk/clk-cdce9xx.c| 12 +++---------1 file changed, 3 insertions(+), 9 deletions(-)Quoted 10 lines
Quoted 10 lines
drivers/clk/clk-cdce9xx.c static int cdce9xx_reg_write(struct udevice *dev, u8 addr, u8 val) · line 88
Quoted 10 lines
drivers/clk/clk-cdce9xx.c +1
-2@@ -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_of_request (struct clk *clk)
cdce9xx_clk_of_requesthere...Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
drivers/clk/clk-cdce9xx.c +1
-5{ 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];Quoted 8 lines
Quoted 8 lines
drivers/clk/clk-cdce9xx.c static const struct udevice_id cdce9xx_clk_of_match[] = { · line 237
Quoted 8 lines
drivers/clk/clk-cdce9xx.c +1
-2- 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,but
cdce9xx_clk_requesthere.
Quoted 1 line
Other than that, looks fine to me.
Oops. Thanks for catching that.
Resubmitted after compile-testing :)
--Sean