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 31229C433F5 for ; Sun, 27 Feb 2022 19:01:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CACDC83BAF; Sun, 27 Feb 2022 20:01:32 +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="W19aTA5H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3723C83BA7; Sun, 27 Feb 2022 20:01:31 +0100 (CET) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (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 CE32483BAF for ; Sun, 27 Feb 2022 20:01:27 +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-x733.google.com with SMTP id j78so8843756qke.2 for ; Sun, 27 Feb 2022 11:01:27 -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=3q5Dp6CbOpvH6eTYJIuAdqmwZEwstyf8tVUvxGP9J1A=; b=W19aTA5HlDzZxgk+rRovyHdhjeduhQkA9k32tW669dAvQSs+p/EcCwiaRvFlrL1C8g bbeF1vT6JzdoPMxP0MHeyV71A0+bNQj2w/Dbf9srfgLPNyHcOj5GzQqQKRViQQM3eo4R itj2lNTxVubmJHD215jYdTxRromWidfuMw06S8s+FuUOuo4S0u3YOT3BAk4UjNkQa0ja ULtHuN/eS8g44U3mFqriX9AEtLid2xhBXE+ZyOWAqG4h4ivvDvqrmAPrm4FgpW8gkljw sAoPXHWiSINZ1uSrm6O83lRPtWzS6XC88k0/+RNYmjGkHsi6/N2tI245L9HBA380FyuD 7T9Q== 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=3q5Dp6CbOpvH6eTYJIuAdqmwZEwstyf8tVUvxGP9J1A=; b=EgL6+J1XzKr3RQgYv5fvVgo2yYHJw2wkX6tZwjZ3IJKsQlgnGqRn/VjwMdVvkfVPZl EPq67RieXw3kBeQCMpW0BBW4elJk1lkFSNh3cLXCVZzw9aswxVky2Be+GoXqHd/QErw+ DD7m0JdvGa+PegUZBCpyVMMXUSin00ch/GeERpKlXlsgoJBJ1ZmDGpP9WQoHx0C4qlXU I1nu0F3o3lNbTmP3OkrAHJ/srh38aYq0PHKmmo+uhsQTWdl1ZLytnGapmL9HfKwNKVtm i7q21W6yWE09s8bHu52rLMCGmb1jHURgEYkUUZYvysD43zFxhm9DJphhBtg+0qsA1RdQ o5GQ== X-Gm-Message-State: AOAM532TahUp58BILLz8NEo3P5Dbq8rdco0+b9yEFi7sNsQySCxu6ltu 0gtblTaq2Rx9Uq8Rz+9pGJWRH7DbgDs= X-Google-Smtp-Source: ABdhPJyYZQUVbKM+FTlzLVmaWfp3ufvVVko0w4arCDnm5tmdVkCiVjIzwA10hWlfs/b/J76dvbWswA== X-Received: by 2002:a05:620a:10ae:b0:47e:1469:69c0 with SMTP id h14-20020a05620a10ae00b0047e146969c0mr9762880qkk.77.1645988486050; Sun, 27 Feb 2022 11:01:26 -0800 (PST) Received: from godwin.fios-router.home (pool-108-18-137-133.washdc.fios.verizon.net. [108.18.137.133]) by smtp.gmail.com with ESMTPSA id y11-20020a05622a004b00b002dea2052d7dsm5590302qtw.12.2022.02.27.11.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 11:01:25 -0800 (PST) From: Sean Anderson To: u-boot@lists.denx.de Cc: Lukasz Majewski , Sean Anderson Subject: [PATCH] clk: Consolidate some clock functions Date: Sun, 27 Feb 2022 14:01:13 -0500 Message-Id: <20220227190113.1617498-1-seanga2@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean These functions are exactly the same as their "nodev" varients, except they accept a device and not an ofnode. Rewrite them to just call the other function. Signed-off-by: Sean Anderson --- drivers/clk/clk-uclass.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index c20c928bf1..4ab876517a 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -138,14 +138,7 @@ static int clk_get_by_indexed_prop(struct udevice *dev, const char *prop_name, int clk_get_by_index(struct udevice *dev, int index, struct clk *clk) { - struct ofnode_phandle_args args; - int ret; - - ret = dev_read_phandle_with_args(dev, "clocks", "#clock-cells", 0, - index, &args); - - return clk_get_by_index_tail(ret, dev_ofnode(dev), &args, "clocks", - index, clk); + return clk_get_by_index_nodev(dev_ofnode(dev), index, clk); } int clk_get_by_index_nodev(ofnode node, int index, struct clk *clk) @@ -400,18 +393,7 @@ int clk_set_defaults(struct udevice *dev, enum clk_defaults_stage stage) int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk) { - int index; - - debug("%s(dev=%p, name=%s, clk=%p)\n", __func__, dev, name, clk); - clk->dev = NULL; - - index = dev_read_stringlist_search(dev, "clock-names", name); - if (index < 0) { - debug("fdt_stringlist_search() failed: %d\n", index); - return index; - } - - return clk_get_by_index(dev, index, clk); + return clk_get_by_name_nodev(dev_ofnode(dev), name, clk); } #endif /* OF_REAL */ -- 2.34.1