Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcsh/dev/hd64461 cosmetic changes.



details:   https://anonhg.NetBSD.org/src/rev/1fb5cc398e3b
branches:  trunk
changeset: 512670:1fb5cc398e3b
user:      uch <uch%NetBSD.org@localhost>
date:      Fri Jul 13 16:21:39 2001 +0000

description:
cosmetic changes.

diffstat:

 sys/arch/hpcsh/dev/hd64461/hd64461.c       |    8 +-
 sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c |  103 ++++++++++++++--------------
 sys/arch/hpcsh/dev/hd64461/hd64461uart.c   |   13 ++-
 3 files changed, 63 insertions(+), 61 deletions(-)

diffs (truncated from 449 to 300 lines):

diff -r 4b7a22cddac5 -r 1fb5cc398e3b sys/arch/hpcsh/dev/hd64461/hd64461.c
--- a/sys/arch/hpcsh/dev/hd64461/hd64461.c      Fri Jul 13 16:14:29 2001 +0000
+++ b/sys/arch/hpcsh/dev/hd64461/hd64461.c      Fri Jul 13 16:21:39 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hd64461.c,v 1.1 2001/02/21 15:39:09 uch Exp $  */
+/*     $NetBSD: hd64461.c,v 1.2 2001/07/13 16:21:39 uch Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -153,7 +153,7 @@
        
        /* attach all sub modules */
        for (i = 0, module = hd64461_modules; i < HD64461_NMODULE;
-            i++, module++) {
+           i++, module++) {
                if (module->name == 0)
                        continue;
                ha.ha_module_id = i;
@@ -168,14 +168,14 @@
 
        if (pnp)
                printf("%s at %s",
-                      hd64461_modules[ha->ha_module_id].name, pnp);
+                   hd64461_modules[ha->ha_module_id].name, pnp);
 
        return (UNCONF);
 }
 
 void *
 hd64461_intr_establish(enum hd64461_irq irq, int mode, int level,
-                      int (*func)(void *), void *arg)
+    int (*func)(void *), void *arg)
 {
        struct hd64461_intr_entry *entry = &hd64461_intr_entry[irq];
        u_int16_t r;
diff -r 4b7a22cddac5 -r 1fb5cc398e3b sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c
--- a/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c        Fri Jul 13 16:14:29 2001 +0000
+++ b/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c        Fri Jul 13 16:21:39 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hd64461pcmcia.c,v 1.5 2001/07/13 16:14:29 uch Exp $    */
+/*     $NetBSD: hd64461pcmcia.c,v 1.6 2001/07/13 16:21:39 uch Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -165,24 +165,22 @@
 };
 
 static int _chip_mem_alloc(pcmcia_chipset_handle_t, bus_size_t,
-                          struct pcmcia_mem_handle *);
+    struct pcmcia_mem_handle *);
 static void _chip_mem_free(pcmcia_chipset_handle_t,
-                          struct pcmcia_mem_handle *);
+    struct pcmcia_mem_handle *);
 static int _chip_mem_map(pcmcia_chipset_handle_t, int, bus_addr_t,
-                        bus_size_t, struct pcmcia_mem_handle *,
-                        bus_addr_t *, int *);
+    bus_size_t, struct pcmcia_mem_handle *, bus_addr_t *, int *);
 static void _chip_mem_unmap(pcmcia_chipset_handle_t, int);
 static int _chip_io_alloc(pcmcia_chipset_handle_t, bus_addr_t,
-                         bus_size_t, bus_size_t, struct pcmcia_io_handle *);
+    bus_size_t, bus_size_t, struct pcmcia_io_handle *);
 static void _chip_io_free(pcmcia_chipset_handle_t, struct pcmcia_io_handle *);
 static int _chip_io_map(pcmcia_chipset_handle_t, int, bus_addr_t,
-                       bus_size_t, struct pcmcia_io_handle *, int *);
+    bus_size_t, struct pcmcia_io_handle *, int *);
 static void _chip_io_unmap(pcmcia_chipset_handle_t, int);
 static void _chip_socket_enable(pcmcia_chipset_handle_t);
 static void _chip_socket_disable(pcmcia_chipset_handle_t);
 static void *_chip_intr_establish(pcmcia_chipset_handle_t,
-                                 struct pcmcia_function *, int,
-                                 int (*)(void *), void *);
+    struct pcmcia_function *, int, int (*)(void *), void *);
 static void _chip_intr_disestablish(pcmcia_chipset_handle_t, void *);
 
 static struct pcmcia_chip_functions hd64461pcmcia_functions = {
@@ -211,12 +209,12 @@
 };
 
 static void hd64461pcmcia_attach_channel(struct hd64461pcmcia_softc *,
-                                        enum controller_channel);
+    enum controller_channel);
 /* hot plug */
 static void hd64461pcmcia_create_event_thread(void *);
 static void hd64461pcmcia_event_thread(void *);
 static void queue_event(struct hd64461pcmcia_channel *,
-                       enum hd64461pcmcia_event_type);
+    enum hd64461pcmcia_event_type);
 /* interrupt handler */
 static int hd64461pcmcia_channel0_intr(void *);
 static int hd64461pcmcia_channel1_intr(void *);
@@ -226,7 +224,7 @@
 static void power_on(enum controller_channel) __attribute__((__unused__));
 /* memory window access ops */
 static void memory_window_mode(enum controller_channel,
-                              enum memory_window_mode)__attribute__((__unused__));
+    enum memory_window_mode)__attribute__((__unused__));
 static void memory_window_16(enum controller_channel, enum memory_window_16);
 /* bus width */
 static void set_bus_width(enum controller_channel, int);
@@ -285,8 +283,8 @@
        int error;
 
        error = kthread_create1(hd64461pcmcia_event_thread, sc,
-                               &sc->sc_event_thread, "%s",
-                               sc->sc_dev.dv_xname);
+           &sc->sc_event_thread, "%s",
+           sc->sc_dev.dv_xname);
        KASSERT(error == 0);
 }
 
@@ -313,7 +311,7 @@
                        case EVENT_REMOVE:
                                DPRINTF("remove event.\n");
                                pcmcia_card_detach(pe->pe_ch->ch_pcmcia,
-                                                  DETACH_FORCE);
+                                   DETACH_FORCE);
                                break;
                        }
                        s = splhigh();
@@ -328,6 +326,7 @@
 static int
 hd64461pcmcia_print(void *arg, const char *pnp)
 {
+
        if (pnp)
                printf("pcmcia at %s", pnp);
 
@@ -339,7 +338,7 @@
 {
        struct pcmciabus_attach_args *paa = aux;
        struct hd64461pcmcia_channel *ch =
-               (struct hd64461pcmcia_channel *)paa->pch;
+           (struct hd64461pcmcia_channel *)paa->pch;
 
        if (ch->ch_channel == CHANNEL_0) {
                if (cf->cf_loc[PCMCIABUSCF_CONTROLLER] !=
@@ -359,7 +358,7 @@
 
 static void
 hd64461pcmcia_attach_channel(struct hd64461pcmcia_softc *sc,
-                            enum controller_channel channel)
+    enum controller_channel channel)
 {
        struct device *parent = (struct device *)sc;
        struct hd64461pcmcia_channel *ch = &sc->sc_ch[channel];
@@ -375,21 +374,21 @@
         */
        /* Attibute/Common memory extent */
        membase = (channel == CHANNEL_0)
-               ? HD64461_PCC0_MEMBASE : HD64461_PCC1_MEMBASE;
+           ? HD64461_PCC0_MEMBASE : HD64461_PCC1_MEMBASE;
 
        ch->ch_memt = bus_space_create(0, "PCMCIA attribute memory",
-                                      membase, 0x01000000); /* 16MB */
+           membase, 0x01000000); /* 16MB */
        bus_space_alloc(ch->ch_memt, 0, 0x00ffffff, 0x01000000,
-                       0x01000000, 0x01000000, 0, &ch->ch_membase_addr,
-                       &ch->ch_memh);
+           0x01000000, 0x01000000, 0, &ch->ch_membase_addr,
+           &ch->ch_memh);
        fixup_sh3_pcmcia_area(ch->ch_memt);
 
        /* Common memory space extent */
        ch->ch_memsize = 0x01000000;
        for (i = 0; i < MEMWIN_16M_MAX; i++) {
                ch->ch_cmemt[i] = bus_space_create(0, "PCMCIA common memory",
-                                                  membase + 0x01000000,
-                                                  ch->ch_memsize);
+                   membase + 0x01000000,
+                   ch->ch_memsize);
                fixup_sh3_pcmcia_area(ch->ch_cmemt[i]);
        }
 
@@ -400,16 +399,16 @@
                ch->ch_iobase = 0;
                ch->ch_iosize = HD64461_PCC0_IOSIZE;
                ch->ch_iot = bus_space_create(0, "PCMCIA I/O port", 
-                                             HD64461_PCC0_IOBASE,
-                                             ch->ch_iosize);
+                   HD64461_PCC0_IOBASE,
+                   ch->ch_iosize);
                fixup_sh3_pcmcia_area(ch->ch_iot);
 
                hd64461_intr_establish(HD64461_IRQ_PCC0, IST_LEVEL, IPL_TTY,
-                                      hd64461pcmcia_channel0_intr, ch);
+                   hd64461pcmcia_channel0_intr, ch);
        } else {
                set_bus_width(CHANNEL_1, PCMCIA_WIDTH_IO16);
                hd64461_intr_establish(HD64461_IRQ_PCC1, IST_EDGE, IPL_TTY,
-                                      hd64461pcmcia_channel1_intr, ch);
+                   hd64461pcmcia_channel1_intr, ch);
        }
 
        paa.paa_busname = "pcmcia";
@@ -418,7 +417,7 @@
        paa.iosize = ch->ch_iosize;
 
        ch->ch_pcmcia = config_found_sm(parent, &paa, hd64461pcmcia_print,
-                                       hd64461pcmcia_submatch);
+           hd64461pcmcia_submatch);
 
        if (ch->ch_pcmcia && (detect_card(ch->ch_channel) == EVENT_INSERT)) {
                ch->ch_attached = 1;
@@ -476,7 +475,7 @@
 
 static void
 queue_event(struct hd64461pcmcia_channel *ch,
-           enum hd64461pcmcia_event_type type)
+    enum hd64461pcmcia_event_type type)
 {
        struct hd64461pcmcia_event *pe, *pool;
        struct hd64461pcmcia_softc *sc = ch->ch_parent;
@@ -497,7 +496,7 @@
 
        if (pe == 0) {
                printf("%s: event FIFO overflow (max %d).\n", __FUNCTION__,
-                      EVENT_QUEUE_MAX);
+                   EVENT_QUEUE_MAX);
                goto out;
        }
 
@@ -522,7 +521,7 @@
  */
 static void *
 _chip_intr_establish(pcmcia_chipset_handle_t pch, struct pcmcia_function *pf,
-                    int ipl, int (*ih_func)(void *), void *ih_arg)
+    int ipl, int (*ih_func)(void *), void *ih_arg)
 {
        struct hd64461pcmcia_channel *ch = (struct hd64461pcmcia_channel *)pch;
        int channel = ch->ch_channel;
@@ -576,7 +575,7 @@
 
 static int
 _chip_mem_alloc(pcmcia_chipset_handle_t pch, bus_size_t size,
-               struct pcmcia_mem_handle *pcmhp)
+    struct pcmcia_mem_handle *pcmhp)
 {
        struct hd64461pcmcia_channel *ch = (struct hd64461pcmcia_channel *)pch;
 
@@ -599,15 +598,15 @@
 
 static int
 _chip_mem_map(pcmcia_chipset_handle_t pch, int kind, bus_addr_t card_addr,
-             bus_size_t size, struct pcmcia_mem_handle *pcmhp,
-             bus_addr_t *offsetp, int *windowp)
+    bus_size_t size, struct pcmcia_mem_handle *pcmhp,
+    bus_addr_t *offsetp, int *windowp)
 {
        struct hd64461pcmcia_channel *ch = (struct hd64461pcmcia_channel *)pch;
        struct hd64461pcmcia_window_cookie *cookie;
        bus_addr_t ofs;
 
        cookie = malloc(sizeof(struct hd64461pcmcia_window_cookie),
-                       M_DEVBUF, M_NOWAIT);
+           M_DEVBUF, M_NOWAIT);
        KASSERT(cookie);
        memset(cookie, 0, sizeof(struct hd64461pcmcia_window_cookie));
 
@@ -615,7 +614,7 @@
        if ((kind & ~PCMCIA_WIDTH_MEM_MASK) == PCMCIA_MEM_ATTR) {
                cookie->wc_tag = ch->ch_memt;
                if (bus_space_subregion(ch->ch_memt, ch->ch_memh, card_addr,
-                                       size, &cookie->wc_handle) != 0)
+                   size, &cookie->wc_handle) != 0)
                        goto bad;
                
                *offsetp = card_addr;
@@ -627,7 +626,7 @@
                cookie->wc_tag = ch->ch_cmemt[window];
                ofs = card_addr - window * ch->ch_memsize;
                if (bus_space_map(cookie->wc_tag, ofs, size, 0,
-                                 &cookie->wc_handle) != 0)
+                   &cookie->wc_handle) != 0)
                        goto bad;
                
                /* XXX bogus. check window per common memory access. */
@@ -639,8 +638,8 @@
        *windowp = (int)cookie;
 
        DPRINTF("(%s) %#lx+%#lx-> %#lx+%#lx\n", kind == PCMCIA_MEM_ATTR ?
-               "attribute" : "common", ch->ch_memh, card_addr, *offsetp,
-               size);
+           "attribute" : "common", ch->ch_memh, card_addr, *offsetp,
+           size);
 
        return (0);
  bad:
@@ -657,14 +656,14 @@
 
        if (cookie->wc_window != -1)
                bus_space_unmap(cookie->wc_tag, cookie->wc_handle,
-                               cookie->wc_size);
+                   cookie->wc_size);
        DPRINTF("%#lx-%#x\n", cookie->wc_handle, cookie->wc_size);
        free(cookie, M_DEVBUF);
 }
 
 static int
 _chip_io_alloc(pcmcia_chipset_handle_t pch, bus_addr_t start, bus_size_t size,
-              bus_size_t align, struct pcmcia_io_handle *pcihp)



Home | Main Index | Thread Index | Old Index