Fix clamp macro redefined warning, and clamp type check warnings.
Signed-off-by: Angelo Dureghello <[email protected]>
---
drivers/spi/cf_qspi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c
index 834c5bd..c4bafe0 100644
--- a/drivers/spi/cf_qspi.c
+++ b/drivers/spi/cf_qspi.c
@@ -19,7 +19,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#define clamp(x, low, high) (min(max(low, x), high))
#define to_cf_qspi_slave(s) container_of(s, struct cf_qspi_slave, slave)
struct cf_qspi_slave {
@@ -119,7 +118,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus,
unsigned int cs,
if (max_hz == 0) /* Go as fast as possible */
dev->qmr = 2u;
else /* Get the closest baud rate */
- dev->qmr = clamp(((gd->bus_clk >> 2) + max_hz - 1)/max_hz,
+ dev->qmr = clamp_val(((gd->bus_clk >> 2) + max_hz - 1)/max_hz,
2u, 255u);
/* Map mode to QMR[CPOL] and QMR[CPHA] */
--
2.1.4
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot