X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fspi%2Fcf_qspi.c;h=e57e63eb47a0f63989dff7fbd1e242c413668e6f;hb=69fd4c386cb4ca60fa5d3c8e28d6601b1a48acac;hp=06bcf91a4aa3e6a7d346e7885592af441261d63f;hpb=0cb8394f8198f5b420a52b6a6f76c9bf21e68b2e;p=u-boot diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c index 06bcf91a4a..e57e63eb47 100644 --- a/drivers/spi/cf_qspi.c +++ b/drivers/spi/cf_qspi.c @@ -5,26 +5,10 @@ * This driver is written to transfer 8 bit at-a-time and uses the dedicated * SPI slave select pins as bit-banged GPIO to work with spi_flash subsystem. * - * * Copyright (C) 2011 Ruggedcom, Inc. * Richard Retanubun (richardretanubun@freescale.com) * - * See file CREDITS for list of people who contributed to this project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -35,8 +19,7 @@ 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, s) +#define to_cf_qspi_slave(s) container_of(s, struct cf_qspi_slave, slave) struct cf_qspi_slave { struct spi_slave slave; /* Specific bus:cs ID for each device */ @@ -136,7 +119,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, dev->qmr = 2u; else /* Get the closest baud rate */ dev->qmr = clamp(((gd->bus_clk >> 2) + max_hz - 1)/max_hz, - 2u, 255u); + 2lu, 255lu); /* Map mode to QMR[CPOL] and QMR[CPHA] */ if (mode & SPI_CPOL)