Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D0A2C433F5 for ; Thu, 16 Dec 2021 13:07:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1D69F83032; Thu, 16 Dec 2021 14:07:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="J7JosY++"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 883F18303C; Thu, 16 Dec 2021 14:06:58 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1C08682F5A for ; Thu, 16 Dec 2021 14:06:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kristo@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B58ABB82404; Thu, 16 Dec 2021 13:06:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A6B8C36AE4; Thu, 16 Dec 2021 13:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639660013; bh=fucFMQWjW8YM8W8NBHpb1Lg0CWusBMkGitD6AKKYDSY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=J7JosY++ZpzDiFRq09tkq5cm9TIo7k+NC30tJIdcuq6iaZFvQSMVtm+fQCQZHBKYZ wzaBkgJgLRfNGWeOeXf/Ab1Rr9tSIhwT6tRRat9JzNkkU7fEoLB1C4jnC7lZimeUyx hyc/XXLsrJvHI43dj6oR//U9MnQcfO/uQxJu0NIgbv5+uajIe73ZYGCTw20SlcV1gH fg4Xx4iyy1jnCvzcX+EiACEBjq7EqF5p5g3+gSUusiSVHmmvjsIYcl12mePvgQPr2c Q3zJ8kLfTYKGvftILrPgucWNK6LrGezBebFCb04/Yd586USyF/cNUV/NKD/CEY+wKE rZ/j1cFu7/pAg== Subject: Re: [PATCH v2 1/2] clk: cdce9xx: Convert .of_xlate to .request To: Sean Anderson , u-boot@lists.denx.de Cc: Lukasz Majewski , Tom Rini References: <20211215164718.2778664-1-seanga2@gmail.com> From: Tero Kristo Message-ID: <782e43b0-23f3-d000-2571-e67f0c604886@kernel.org> Date: Thu, 16 Dec 2021 15:06:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211215164718.2778664-1-seanga2@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 Looks good to me now. Reviewed-by: Tero Kristo > --- > > 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, > }; >