Module Name:    src
Committed By:   skrll
Date:           Fri Aug 28 13:13:55 UTC 2020

Modified Files:
        src/sys/arch/arm/broadcom: bcm2835_emmc.c

Log Message:
Fix build if NBCMDMAC is zero


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/broadcom/bcm2835_emmc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.37 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.38
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.37	Sun May 31 23:52:19 2020
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Fri Aug 28 13:13:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.37 2020/05/31 23:52:19 thorpej Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.38 2020/08/28 13:13:55 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.37 2020/05/31 23:52:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.38 2020/08/28 13:13:55 skrll Exp $");
 
 #include "bcmdmac.h"
 
@@ -118,11 +118,8 @@ bcmemmc_attach(device_t parent, device_t
 	struct bcmemmc_softc *sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
 	const int phandle = faa->faa_phandle;
-	enum bcmemmc_type type;
 	int error;
 
-	type = of_search_compatible(phandle, compat_data)->data;
-
 	sc->sc.sc_dev = self;
 	sc->sc.sc_dmat = faa->faa_dmat;
 	sc->sc.sc_flags = 0;
@@ -186,6 +183,8 @@ bcmemmc_attach(device_t parent, device_t
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
 #if NBCMDMAC > 0
+	enum bcmemmc_type type = of_search_compatible(phandle, compat_data)->data;
+
 	if (type != BCM2835_SDHCI)
 		goto done;
 

Reply via email to