]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/i2c/fsl_i2c.c
Add more SPDX-License-Identifier tags
[people/ms/u-boot.git] / drivers / i2c / fsl_i2c.c
index 7bb1702bba283aa5b58000e12a4a3187a909137e..b56a1c2541d7165fbd2cc0ac7db7affe61c640d0 100644 (file)
@@ -4,19 +4,7 @@
  * 2012, Heiko Schocher, DENX Software Engineering, hs@denx.de.
  * Changes for multibus/multiadapter I2C support.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
- *
- * 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 <common.h>
@@ -127,7 +115,7 @@ static const struct {
 static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
        unsigned int i2c_clk, unsigned int speed)
 {
-       unsigned short divider = min(i2c_clk / speed, (unsigned short) -1);
+       unsigned short divider = min(i2c_clk / speed, (unsigned int)USHRT_MAX);
 
        /*
         * We want to choose an FDR/DFSR that generates an I2C bus speed that