X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Frenesas%2Fsh7785lcr%2Fselfcheck.c;h=9a6cdab9ee5b633d2bdf6b7ec0d90fa5cc1c3724;hb=0f70d705cf359b6217db1bca5ee7e1c03dc85dea;hp=44247c850fe6aeeb093a3648c6773cfa5e8eb76b;hpb=2271d3ddccfbd4a7640121669ff9b013b1fea361;p=u-boot diff --git a/board/renesas/sh7785lcr/selfcheck.c b/board/renesas/sh7785lcr/selfcheck.c index 44247c850f..9a6cdab9ee 100644 --- a/board/renesas/sh7785lcr/selfcheck.c +++ b/board/renesas/sh7785lcr/selfcheck.c @@ -1,23 +1,11 @@ /* * Copyright (C) 2008 Yoshihiro Shimoda * - * 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 +#include #include #include #include @@ -33,12 +21,6 @@ #define SM107_DEVICEID (0x13e00060 + NOCACHE_OFFSET) -static void wait_ms(unsigned long time) -{ - while (time--) - udelay(1000); -} - static void test_pld(void) { printf("PLD version = %04x\n", readb(PLD_VERSR)); @@ -53,10 +35,10 @@ static void test_led(void) { printf("turn on LEDs 3, 5, 7, 9\n"); writeb(0x55, PLD_LEDCR); - wait_ms(2000); + mdelay(2000); printf("turn on LEDs 4, 6, 8, 10\n"); writeb(0xaa, PLD_LEDCR); - wait_ms(2000); + mdelay(2000); writeb(0x00, PLD_LEDCR); } @@ -112,10 +94,8 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *cmd; - if (argc != 2) { - cmd_usage(cmdtp); - return 1; - } + if (argc != 2) + return cmd_usage(cmdtp); cmd = argv[1]; switch (cmd[0]) { @@ -150,8 +130,7 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) test_net(); break; default: - cmd_usage(cmdtp); - return 1; + return cmd_usage(cmdtp); } return 0;