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 CEC12C433F5 for ; Wed, 1 Dec 2021 19:44:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 80EFC8309F; Wed, 1 Dec 2021 20:44:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="e2IuUqx9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28920830A2; Wed, 1 Dec 2021 20:44:14 +0100 (CET) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F0CB68309F for ; Wed, 1 Dec 2021 20:44:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x735.google.com with SMTP id 132so32224052qkj.11 for ; Wed, 01 Dec 2021 11:44:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kmkoQ5WAVlFtr7Imz5VQb5fnxDjz+Rc0mn0C1Z91Liw=; b=e2IuUqx9jPdfkBR4YvMiIIfH9dGu0qmqe0HKgn0kvSK/GxhwMA3GDg6zq7q5GCm43w JG1J1V1MfxvgasqxZR/C7hcTycvmGYVIDcDEb+XhM+Socb07iOS8RB6bWjFfj0olz1MZ FwVJoM6xwQRG4kevY6yb+nyg/71mUcy9KK9xlNdZqnHtKGke4RofVI30myy1GkAoQ02F 0MFzIs1qX9wlSuLHEnn4sDOTO0L3qommbUmyB3Cz/8oOTiOEhYirGOLh4bZwMoPf0oYj 27pShc134vM1LOuoxMRt0fgp78HxKJ6iLoI4uVU1MBEMlPkCSJ4oQr+yO1DTNKp1gY3f htSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kmkoQ5WAVlFtr7Imz5VQb5fnxDjz+Rc0mn0C1Z91Liw=; b=0BbkWKSd2nrVng1N2E19yS53WDj7D5QoDTxijehJXM6hQywOWN8GxU9gAqgonYBWjw cyxpYWpc+Y5khWsnb4pp8AAWtyrrI5hrYzVEdDVHDKx2F58m/6ya8kvgAUPM8gOhmGWq p+srjNRuNwrp46IitSYZz5GgW/XbIkytmB0+vn1Bb7V6OGLeVO6KM/pBkkn9SlKBe9MJ Yjfyo+n1f+muOumZOL4vD5Tfv6yMrcffCrUpu5VkNYJrcZisHNNndBgB65ucfdxszvfh XY2+CkD80uZB3cY+tVERhmEowvMP3Ky2GDSeHP//ZLo0FaFMw9Xu5Oeelm3wfjZltZFr MQjw== X-Gm-Message-State: AOAM530s30uMaiKmnjnHhzkiRUoZW887DDKk2GzKe6qs3Y2HC8Vdqu7d eltrnZmilFvgQXEzJbhldfUUB0rR52E= X-Google-Smtp-Source: ABdhPJyb/IDs02r+S+PYbi5zgA4YfdT3YXC1FdlZUQNPXi3Mvuez4ndtO5tiuYldCCXle6apnzgBwQ== X-Received: by 2002:a05:620a:2447:: with SMTP id h7mr8138811qkn.75.1638387849630; Wed, 01 Dec 2021 11:44:09 -0800 (PST) Received: from godwin.fios-router.home (pool-108-18-207-184.washdc.fios.verizon.net. [108.18.207.184]) by smtp.gmail.com with ESMTPSA id a15sm411245qtb.5.2021.12.01.11.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Dec 2021 11:44:09 -0800 (PST) From: Sean Anderson To: u-boot@lists.denx.de Cc: Lukasz Majewski , Tero Kristo , Tom Rini , Sean Anderson Subject: [PATCH 1/2] clk: cdce9xx: Convert .of_xlate to .request Date: Wed, 1 Dec 2021 14:44:02 -0500 Message-Id: <20211201194403.2172991-1-seanga2@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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 This xlate function just performs some checking. We can do this in request() instead and use the default xlate. Signed-off-by: Sean Anderson --- 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..c15e9f210e 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_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, }; -- 2.33.0