Thu Sep 5 07:06:37 2013 UTC ()
Whitespace


(skrll)
diff -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835_emmc.c

cvs diff -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835_emmc.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_emmc.c 2013/04/14 15:11:52 1.8
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c 2013/09/05 07:06:37 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_emmc.c,v 1.8 2013/04/14 15:11:52 skrll Exp $ */ 1/* $NetBSD: bcm2835_emmc.c,v 1.9 2013/09/05 07:06:37 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2012 The NetBSD Foundation, Inc. 4 * Copyright (c) 2012 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Nick Hudson 8 * by Nick Hudson
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.8 2013/04/14 15:11:52 skrll Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.9 2013/09/05 07:06:37 skrll Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/bus.h> 38#include <sys/bus.h>
39 39
40#include <arm/broadcom/bcm2835reg.h> 40#include <arm/broadcom/bcm2835reg.h>
41#include <arm/broadcom/bcm_amba.h> 41#include <arm/broadcom/bcm_amba.h>
42 42
43#include <dev/sdmmc/sdhcreg.h> 43#include <dev/sdmmc/sdhcreg.h>
44#include <dev/sdmmc/sdhcvar.h> 44#include <dev/sdmmc/sdhcvar.h>
45#include <dev/sdmmc/sdmmcvar.h> 45#include <dev/sdmmc/sdmmcvar.h>
46 46
@@ -116,27 +116,27 @@ bcmemmc_attach(device_t parent, device_t @@ -116,27 +116,27 @@ bcmemmc_attach(device_t parent, device_t
116 aprint_normal(": SDHC controller\n"); 116 aprint_normal(": SDHC controller\n");
117 117
118 sc->sc_ih = bcm2835_intr_establish(aaa->aaa_intr, IPL_SDMMC, sdhc_intr, 118 sc->sc_ih = bcm2835_intr_establish(aaa->aaa_intr, IPL_SDMMC, sdhc_intr,
119 &sc->sc); 119 &sc->sc);
120 120
121 if (sc->sc_ih == NULL) { 121 if (sc->sc_ih == NULL) {
122 aprint_error_dev(self, "failed to establish interrupt %d\n", 122 aprint_error_dev(self, "failed to establish interrupt %d\n",
123 aaa->aaa_intr); 123 aaa->aaa_intr);
124 goto fail; 124 goto fail;
125 } 125 }
126 aprint_normal_dev(self, "interrupting on intr %d\n", aaa->aaa_intr); 126 aprint_normal_dev(self, "interrupting on intr %d\n", aaa->aaa_intr);
127 127
128 error = sdhc_host_found(&sc->sc, sc->sc_iot, sc->sc_ioh, 128 error = sdhc_host_found(&sc->sc, sc->sc_iot, sc->sc_ioh,
129 aaa->aaa_size); 129 aaa->aaa_size);
130 if (error != 0) { 130 if (error != 0) {
131 aprint_error_dev(self, "couldn't initialize host, error=%d\n", 131 aprint_error_dev(self, "couldn't initialize host, error=%d\n",
132 error); 132 error);
133 goto fail; 133 goto fail;
134 } 134 }
135 return; 135 return;
136 136
137fail: 137fail:
138 if (sc->sc_ih) { 138 if (sc->sc_ih) {
139 intr_disestablish(sc->sc_ih); 139 intr_disestablish(sc->sc_ih);
140 sc->sc_ih = NULL; 140 sc->sc_ih = NULL;
141 } 141 }
142 bus_space_unmap(sc->sc_iot, sc->sc_ioh, aaa->aaa_size); 142 bus_space_unmap(sc->sc_iot, sc->sc_ioh, aaa->aaa_size);