u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Tero Kristo <kristo@kernel.org>
To: Sean Anderson <seanga2@gmail.com>, u-boot@lists.denx.de
Cc: Lukasz Majewski <lukma@denx.de>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v2 1/2] clk: cdce9xx: Convert .of_xlate to .request
Date: Thu, 16 Dec 2021 15:06:49 +0200	[thread overview]
Message-ID: <782e43b0-23f3-d000-2571-e67f0c604886@kernel.org> (raw)
In-Reply-To: <20211215164718.2778664-1-seanga2@gmail.com>

On 15/12/2021 18:47, Sean Anderson wrote:
> 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>

Looks good to me now.

Reviewed-by: Tero Kristo <kristo@kernel.org>

> ---
> 
> Changes in v2:
> - Fix build error caused by mismatched function name
> 
>   drivers/clk/clk-cdce9xx.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/clk/clk-cdce9xx.c b/drivers/clk/clk-cdce9xx.c
> index 6634b7b799..f23465d7e1 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,
>   };
> 


  parent reply	other threads:[~2021-12-16 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 16:47 [PATCH v2 1/2] clk: cdce9xx: Convert .of_xlate to .request Sean Anderson
2021-12-15 16:47 ` [PATCH v2 2/2] clk: cdce9xxx: Add maintainer Sean Anderson
2021-12-16 13:17   ` Tero Kristo
2021-12-16 13:57     ` Sean Anderson
2021-12-16 14:07       ` Tero Kristo
2021-12-16 14:29         ` Sean Anderson
2021-12-16 13:06 ` Tero Kristo [this message]
2022-01-15 20:40 ` (subset) [PATCH v2 1/2] clk: cdce9xx: Convert .of_xlate to .request Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=782e43b0-23f3-d000-2571-e67f0c604886@kernel.org \
    --to=kristo@kernel.org \
    --cc=lukma@denx.de \
    --cc=seanga2@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).