Coding Style cleanup: remove trailing white space
[platform/kernel/u-boot.git] / board / amcc / taishan / lcd.c
index d432cc3..124b81e 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2007
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
- * 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 <config.h>
@@ -35,8 +19,6 @@
 #define LCD_DATA_ADDR          ((volatile char *)(CONFIG_SYS_EBC2_LCM_BASE+1))
 #define LCD_BLK_CTRL           ((volatile char *)(CONFIG_SYS_EBC1_FPGA_BASE+0x2))
 
-#define mdelay(t)      ({unsigned long msec=(t); while (msec--) { udelay(1000);}})
-
 static int g_lcd_init_b = 0;
 static char *amcc_logo = "  AMCC TAISHAN  440GX EvalBoard";
 static char addr_flag = 0x80;
@@ -152,46 +134,42 @@ int lcd_init(void)
        return 0;
 }
 
-static int do_lcd_test(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_lcd_test(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        lcd_init();
        return 0;
 }
 
-static int do_lcd_clear(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_lcd_clear(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        *LCD_CMD_ADDR = 0x01;
        mdelay(LCD_DELAY_NORMAL_MS);
        return 0;
 }
-static int do_lcd_puts(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_lcd_puts(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
-       if (argc < 2) {
-               cmd_usage(cmdtp);
-               return 1;
-       }
+       if (argc < 2)
+               return cmd_usage(cmdtp);
+
        lcd_puts(argv[1]);
        return 0;
 }
-static int do_lcd_putc(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_lcd_putc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
-       if (argc < 2) {
-               cmd_usage(cmdtp);
-               return 1;
-       }
+       if (argc < 2)
+               return cmd_usage(cmdtp);
+
        lcd_putc((char)argv[1][0]);
        return 0;
 }
-static int do_lcd_cur(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_lcd_cur(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        ulong count;
        ulong dir;
        char cur_addr;
 
-       if (argc < 3) {
-               cmd_usage(cmdtp);
-               return 1;
-       }
+       if (argc < 3)
+               return cmd_usage(cmdtp);
 
        count = simple_strtoul(argv[1], NULL, 16);
        if (count > 31) {
@@ -356,7 +334,7 @@ void set_phy_normal_mode(void)
 }
 #endif /* 0 - test only */
 
-static int do_led_test_off(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_led_test_off(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        volatile unsigned int *GpioOr =
                (volatile unsigned int *)(CONFIG_SYS_PERIPHERAL_BASE + 0x700);
@@ -364,7 +342,7 @@ static int do_led_test_off(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        return 0;
 }
 
-static int do_led_test_on(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_led_test_on(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        volatile unsigned int *GpioOr =
                (volatile unsigned int *)(CONFIG_SYS_PERIPHERAL_BASE + 0x700);