]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
fpga: altera: Move altera_validate to the top
authorMarek Vasut <marex@denx.de>
Tue, 16 Sep 2014 18:32:51 +0000 (20:32 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 6 Oct 2014 15:31:41 +0000 (17:31 +0200)
Move the function to the top of the file to avoid forward declaration.
No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
drivers/fpga/altera.c

index b0f323fbef37126e5a927f662597cf421fd57504..9e9df505e52ea2a19cbeedc1a058e9f429e3caf6 100644 (file)
 #define FPGA_DEBUG     0
 
 /* Local Static Functions */
-static int altera_validate (Altera_desc * desc, const char *fn);
+static int altera_validate(Altera_desc *desc, const char *fn)
+{
+       if (!desc) {
+               printf("%s: NULL descriptor!\n", fn);
+               return false;
+       }
+
+       if ((desc->family < min_altera_type) ||
+           (desc->family > max_altera_type)) {
+               printf("%s: Invalid family type, %d\n", fn, desc->family);
+               return false;
+       }
+
+       if ((desc->iface < min_altera_iface_type) ||
+           (desc->iface > max_altera_iface_type)) {
+               printf("%s: Invalid Interface type, %d\n", fn, desc->iface);
+               return false;
+       }
+
+       if (!desc->size) {
+               printf("%s: NULL part size\n", fn);
+               return false;
+       }
+
+       return true;
+}
 
 /* ------------------------------------------------------------------------- */
 int altera_load(Altera_desc *desc, const void *buf, size_t bsize)
@@ -194,34 +219,3 @@ int altera_info(Altera_desc *desc)
 
        return ret_val;
 }
-
-/* ------------------------------------------------------------------------- */
-
-static int altera_validate(Altera_desc *desc, const char *fn)
-{
-       if (!desc) {
-               printf("%s: NULL descriptor!\n", fn);
-               return false;
-       }
-
-       if ((desc->family < min_altera_type) ||
-           (desc->family > max_altera_type)) {
-               printf("%s: Invalid family type, %d\n", fn, desc->family);
-               return false;
-       }
-
-       if ((desc->iface < min_altera_iface_type) ||
-           (desc->iface > max_altera_iface_type)) {
-               printf("%s: Invalid Interface type, %d\n", fn, desc->iface);
-               return false;
-       }
-
-       if (!desc->size) {
-               printf("%s: NULL part size\n", fn);
-               return false;
-       }
-
-       return true;
-}
-
-/* ------------------------------------------------------------------------- */