]> git.sur5r.net Git - u-boot/blobdiff - arch/avr32/cpu/at32ap700x/clk.c
stm32: Correct positioning of declaration
[u-boot] / arch / avr32 / cpu / at32ap700x / clk.c
index 742bc6b5a21c42b010c83b9a68516036ff665acc..0fc6088e3ee10e23584df8203a92ad39dfd15b33 100644 (file)
@@ -1,30 +1,14 @@
 /*
  * Copyright (C) 2005-2008 Atmel Corporation
  *
- * 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 <common.h>
 
 #include <asm/io.h>
 
 #include <asm/arch/clk.h>
-#include <asm/arch/memory-map.h>
+#include <asm/arch/hardware.h>
 #include <asm/arch/portmux.h>
 
 #include "sm.h"
@@ -88,7 +72,7 @@ unsigned long __gclk_set_rate(unsigned int id, enum gclk_parent parent,
                sm_writel(PM_GCCTRL(id), parent | SM_BIT(CEN));
                rate = parent_rate;
        } else {
-               divider = min(255, divider / 2 - 1);
+               divider = min(255UL, divider / 2 - 1);
                sm_writel(PM_GCCTRL(id), parent | SM_BIT(CEN) | SM_BIT(DIVEN)
                                | SM_BF(DIV, divider));
                rate = parent_rate / (2 * (divider + 1));