[RESEND PATCH v4 3/3] test: dm: spi: Replace _spi_get_bus_and_cs() by spi_get_bus_and_cs() in some case

Patrice Chotard patrice.chotard at foss.st.com
Wed May 18 08:46:48 CEST 2022


In case _spi_get_bus_and_cs()'s parameters drv_name and dev_name are
respectively set to NULL and 0, use spi_get_bus_and_cs() instead.

Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>

Cc: Marek Behun <marek.behun at nic.cz>
Cc: Jagan Teki <jagan at amarulasolutions.com>
Cc: Vignesh R <vigneshr at ti.com>
Cc: Joe Hershberger <joe.hershberger at ni.com>
Cc: Ramon Fried <rfried.dev at gmail.com>
Cc: Lukasz Majewski <lukma at denx.de>
Cc: Marek Vasut <marex at denx.de>
Cc: Wolfgang Denk <wd at denx.de>
Cc: Simon Glass <sjg at chromium.org>
Cc: Stefan Roese <sr at denx.de>
Cc: "Pali Rohár" <pali at kernel.org>
Cc: Konstantin Porotchkin <kostap at marvell.com>
Cc: Igal Liberman <igall at marvell.com>
Cc: Bin Meng <bmeng.cn at gmail.com>
Cc: Pratyush Yadav <p.yadav at ti.com>
Cc: Sean Anderson <seanga2 at gmail.com>
Cc: Anji J <anji.jagarlmudi at nxp.com>
Cc: Biwen Li <biwen.li at nxp.com>
Cc: Priyanka Jain <priyanka.jain at nxp.com>
Cc: Chaitanya Sakinam <chaitanya.sakinam at nxp.com>
---

(no changes since v1)

 test/dm/spi.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/test/dm/spi.c b/test/dm/spi.c
index 7ab0820abb..325799bbf1 100644
--- a/test/dm/spi.c
+++ b/test/dm/spi.c
@@ -46,8 +46,7 @@ static int dm_test_spi_find(struct unit_test_state *uts)
 
 	/* This finds nothing because we removed the device */
 	ut_asserteq(-ENODEV, spi_find_bus_and_cs(busnum, cs, &bus, &dev));
-	ut_asserteq(-ENODEV, _spi_get_bus_and_cs(busnum, cs, speed, mode,
-						 NULL, 0, &bus, &slave));
+	ut_asserteq(-ENODEV, spi_get_bus_and_cs(busnum, cs, &bus, &slave));
 
 	/*
 	 * This forces the device to be re-added, but there is no emulation
@@ -143,14 +142,12 @@ static int dm_test_spi_claim_bus(struct unit_test_state *uts)
 	struct udevice *bus;
 	struct spi_slave *slave_a, *slave_b;
 	struct dm_spi_slave_plat *slave_plat;
-	const int busnum = 0, cs_a = 0, cs_b = 1, mode = 0;
+	const int busnum = 0, cs_a = 0, cs_b = 1;
 
 	/* Get spi slave on CS0 */
-	ut_assertok(_spi_get_bus_and_cs(busnum, cs_a, 1000000, mode, NULL, 0,
-					&bus, &slave_a));
+	ut_assertok(spi_get_bus_and_cs(busnum, cs_a, &bus, &slave_a));
 	/* Get spi slave on CS1 */
-	ut_assertok(_spi_get_bus_and_cs(busnum, cs_b, 1000000, mode, NULL, 0,
-					&bus, &slave_b));
+	ut_assertok(spi_get_bus_and_cs(busnum, cs_b, &bus, &slave_b));
 
 	/* Different max_hz, different mode. */
 	ut_assert(slave_a->max_hz != slave_b->max_hz);
@@ -179,12 +176,11 @@ static int dm_test_spi_xfer(struct unit_test_state *uts)
 {
 	struct spi_slave *slave;
 	struct udevice *bus;
-	const int busnum = 0, cs = 0, mode = 0;
+	const int busnum = 0, cs = 0;
 	const char dout[5] = {0x9f};
 	unsigned char din[5];
 
-	ut_assertok(_spi_get_bus_and_cs(busnum, cs, 1000000, mode, NULL, 0,
-					&bus, &slave));
+	ut_assertok(spi_get_bus_and_cs(busnum, cs, &bus, &slave));
 	ut_assertok(spi_claim_bus(slave));
 	ut_assertok(spi_xfer(slave, 40, dout, din,
 			     SPI_XFER_BEGIN | SPI_XFER_END));
-- 
2.25.1



More information about the U-Boot mailing list