]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
stdio: Remove redundant code around stdio_register() calls
authorSimon Glass <sjg@chromium.org>
Wed, 23 Jul 2014 12:54:58 +0000 (06:54 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 23 Jul 2014 13:07:23 +0000 (14:07 +0100)
There is no point in setting a structure's memory to NULL when it has
already been zeroed with memset().

Also, there is no need to create a stub function for stdio to call - if the
function is NULL it will not be called.

This is a clean-up, with no change in functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
arch/x86/lib/video.c
board/bf527-ezkit/video.c
board/bf548-ezkit/video.c
board/cm-bf548/video.c
board/mpl/common/kbd.c
common/usb_kbd.c
drivers/input/keyboard.c
drivers/video/cfb_console.c

index dfd2a8496e72e10fcec3fcbad750babac54aea8e..eb9c595a4e08085e73c814edfb0809c90bbb9ade 100644 (file)
@@ -178,8 +178,6 @@ int video_init(void)
        vga_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
        vga_dev.putc  = video_putc;        /* 'putc' function */
        vga_dev.puts  = video_puts;        /* 'puts' function */
-       vga_dev.tstc  = NULL;              /* 'tstc' function */
-       vga_dev.getc  = NULL;              /* 'getc' function */
 
        if (stdio_register(&vga_dev) == 0)
                return 1;
@@ -191,8 +189,6 @@ int video_init(void)
        strcpy(kbd_dev.name, "kbd");
        kbd_dev.ext   = 0;
        kbd_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-       kbd_dev.putc  = NULL;        /* 'putc' function */
-       kbd_dev.puts  = NULL;        /* 'puts' function */
        kbd_dev.tstc  = i8042_tstc;  /* 'tstc' function */
        kbd_dev.getc  = i8042_getc;  /* 'getc' function */
 
index 5d8a0910de03bb71ab1b3a96ad099f9b3eee9b58..c2bf145013f9388cd40f1e572f2f86b6aef5e088 100644 (file)
@@ -391,14 +391,6 @@ void video_stop(void)
 #endif
 }
 
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
 int drv_video_init(void)
 {
        int error, devices = 1;
@@ -448,8 +440,6 @@ int drv_video_init(void)
        strcpy(videodev.name, "video");
        videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
        videodev.flags = DEV_FLAGS_SYSTEM;      /* No Output */
-       videodev.putc = video_putc;     /* 'putc' function */
-       videodev.puts = video_puts;     /* 'puts' function */
 
        error = stdio_register(&videodev);
 
index 6737ac16284c3e462d9d2a4962e90f7892d9e3f0..47e68c6a9780f9705c99b3dd1eb38c7759ae3e41 100644 (file)
@@ -281,14 +281,6 @@ static void dma_bitblit(void *dst, fastimage_t *logo, int x, int y)
 
 }
 
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
 int drv_video_init(void)
 {
        int error, devices = 1;
@@ -338,8 +330,6 @@ int drv_video_init(void)
        strcpy(videodev.name, "video");
        videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
        videodev.flags = DEV_FLAGS_SYSTEM;      /* No Output */
-       videodev.putc = video_putc;     /* 'putc' function */
-       videodev.puts = video_puts;     /* 'puts' function */
 
        error = stdio_register(&videodev);
 
index c35d28507088d429b7a54826965869c5393c78f4..b098615d4c04a2f71e611a08f6e0d87a8efca07f 100644 (file)
@@ -283,14 +283,6 @@ static void dma_bitblit(void *dst, fastimage_t *logo, int x, int y)
 
 }
 
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
 int drv_video_init(void)
 {
        int error, devices = 1;
@@ -342,8 +334,6 @@ int drv_video_init(void)
        strcpy(videodev.name, "video");
        videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
        videodev.flags = DEV_FLAGS_SYSTEM;      /* No Output */
-       videodev.putc = video_putc;     /* 'putc' function */
-       videodev.puts = video_puts;     /* 'puts' function */
 
        error = stdio_register(&videodev);
 
index 1b5487b144c838c22040fe09bc668e239dbed897..f56545ec032275c23e2881bfdacd3730fce7b879 100644 (file)
@@ -204,8 +204,6 @@ int drv_isa_kbd_init (void)
        memset (&kbddev, 0, sizeof(kbddev));
        strcpy(kbddev.name, DEVNAME);
        kbddev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-       kbddev.putc = NULL ;
-       kbddev.puts = NULL ;
        kbddev.getc = kbd_getc ;
        kbddev.tstc = kbd_testc ;
 
index 0b77c16c5ffc5c05cef1137900ff8caf8b565528..371e5bc1440da53c4390504d83451ccb897c4fcc 100644 (file)
@@ -522,8 +522,6 @@ int drv_usb_kbd_init(void)
                memset(&usb_kbd_dev, 0, sizeof(struct stdio_dev));
                strcpy(usb_kbd_dev.name, DEVNAME);
                usb_kbd_dev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-               usb_kbd_dev.putc = NULL;
-               usb_kbd_dev.puts = NULL;
                usb_kbd_dev.getc = usb_kbd_getc;
                usb_kbd_dev.tstc = usb_kbd_testc;
                usb_kbd_dev.priv = (void *)dev;
index 614592ef3c18febcf27f23a7ac600208d9db03aa..5ef1cc06ed8328e57e4074e84d27bfa0712bfc65 100644 (file)
@@ -275,8 +275,6 @@ int kbd_init (void)
        memset (&kbddev, 0, sizeof(kbddev));
        strcpy(kbddev.name, DEVNAME);
        kbddev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-       kbddev.putc = NULL ;
-       kbddev.puts = NULL ;
        kbddev.getc = kbd_getc ;
        kbddev.tstc = kbd_testc ;
 
index b52e9edd25277c4b79acc7c7754ca1881530ada1..1cf8660510b33625a7e7ad031102c0bfeb646d2d 100644 (file)
@@ -2279,8 +2279,6 @@ int drv_video_init(void)
        console_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
        console_dev.putc = video_putc;  /* 'putc' function */
        console_dev.puts = video_puts;  /* 'puts' function */
-       console_dev.tstc = NULL;        /* 'tstc' function */
-       console_dev.getc = NULL;        /* 'getc' function */
 
 #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
        /* Also init console device */