public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v10 04/21] clk: Fix clk_get_by_* handling of index
Date: Sat,  2 May 2020 22:46:20 -0400	[thread overview]
Message-ID: <20200503024637.327733-5-seanga2@gmail.com> (raw)
In-Reply-To: <20200503024637.327733-1-seanga2@gmail.com>

clk_get_by_index_nodev only ever fetched clock 1, due to passing a boolean
predicate instead of the index. Other clk_get_by_* functions got the clock
correctly, but passed a predicate instead of the index to clk_get_by_tail.
This could lead to confusing error messages.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
CC: Lukasz Majewski <lukma@denx.de>
---

Changes in v7:
- New

 drivers/clk/clk-uclass.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index aa8dd9d027..c082fe95ff 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -121,7 +121,7 @@ static int clk_get_by_indexed_prop(struct udevice *dev, const char *prop_name,
 
 
 	return clk_get_by_index_tail(ret, dev_ofnode(dev), &args, "clocks",
-				     index > 0, clk);
+				     index, clk);
 }
 
 int clk_get_by_index(struct udevice *dev, int index, struct clk *clk)
@@ -133,7 +133,7 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk)
 					 index, &args);
 
 	return clk_get_by_index_tail(ret, dev_ofnode(dev), &args, "clocks",
-				     index > 0, clk);
+				     index, clk);
 }
 
 int clk_get_by_index_nodev(ofnode node, int index, struct clk *clk)
@@ -142,10 +142,10 @@ int clk_get_by_index_nodev(ofnode node, int index, struct clk *clk)
 	int ret;
 
 	ret = ofnode_parse_phandle_with_args(node, "clocks", "#clock-cells", 0,
-					     index > 0, &args);
+					     index, &args);
 
 	return clk_get_by_index_tail(ret, node, &args, "clocks",
-				     index > 0, clk);
+				     index, clk);
 }
 
 int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk)
-- 
2.26.2

  parent reply	other threads:[~2020-05-03  2:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03  2:46 [PATCH v10 00/21] riscv: Add Sipeed Maix support Sean Anderson
2020-05-03  2:46 ` [PATCH v10 01/21] clk: Always use the supplied struct clk Sean Anderson
2020-05-03  2:46 ` [PATCH v10 02/21] clk: Check that ops of composite clock components exist before calling Sean Anderson
2020-05-03  2:46 ` [PATCH v10 03/21] clk: Unconditionally recursively en-/dis-able clocks Sean Anderson
2020-05-03  2:46 ` Sean Anderson [this message]
2020-05-03  2:46 ` [PATCH v10 05/21] clk: Add K210 pll support Sean Anderson
2020-05-03  2:46 ` [PATCH v10 06/21] clk: Add a bypass clock for K210 Sean Anderson
2020-05-03  2:46 ` [PATCH v10 07/21] clk: Add K210 clock support Sean Anderson
2020-05-03  2:46 ` [PATCH v10 08/21] dm: Add support for simple-pm-bus Sean Anderson
2020-05-03  2:46 ` [PATCH v10 09/21] dm: Fix error handling for dev_read_addr_ptr Sean Anderson
2020-05-03  2:46 ` [PATCH v10 10/21] reset: Add generic reset driver Sean Anderson
2020-05-03  2:46 ` [PATCH v10 11/21] lib: Always set errno in hcreate_r Sean Anderson
2020-05-03  2:46 ` [PATCH v10 12/21] riscv: Add headers for asm/global_data.h Sean Anderson
2020-05-03  2:46 ` [PATCH v10 13/21] riscv: Clear pending interrupts before enabling IPIs Sean Anderson
2020-05-03  2:46 ` [PATCH v10 14/21] riscv: Clean up IPI initialization code Sean Anderson
2020-05-05  1:46   ` Rick Chen
2020-05-03  2:46 ` [PATCH v10 15/21] riscv: Add option to support RISC-V privileged spec 1.9 Sean Anderson
2020-05-03  2:46 ` [PATCH v10 16/21] riscv: Allow use of reset drivers Sean Anderson
2020-05-03  2:46 ` [PATCH v10 17/21] riscv: Try to get cpu frequency from a "clocks" node if it exists Sean Anderson
2020-05-03  2:46 ` [PATCH v10 18/21] riscv: Enable cpu clock if it is present Sean Anderson
2020-05-03  2:46 ` [PATCH v10 19/21] riscv: Add device tree for K210 and Sipeed Maix BitM Sean Anderson
2020-05-03  2:46 ` [PATCH v10 20/21] doc: riscv: Add documentation for Sipeed Maix Bit Sean Anderson
2020-05-05  9:01   ` Rick Chen
2020-05-05 17:02     ` Sean Anderson
2020-05-05 19:26       ` Sean Anderson
2020-05-06  6:05         ` Rick Chen
2020-05-06  6:15           ` Sean Anderson
2020-05-03  2:46 ` [PATCH v10 21/21] riscv: Add Sipeed Maix support 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=20200503024637.327733-5-seanga2@gmail.com \
    --to=seanga2@gmail.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