Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Check if we have any SCSI busses so this file do...



details:   https://anonhg.NetBSD.org/src/rev/f0f584319223
branches:  trunk
changeset: 580571:f0f584319223
user:      augustss <augustss%NetBSD.org@localhost>
date:      Fri Apr 29 17:52:46 2005 +0000

description:
Check if we have any SCSI busses so this file doesn't cause link errors
if used without SCSI.

diffstat:

 sys/dev/usb/usscanner.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r d9bebdf23b19 -r f0f584319223 sys/dev/usb/usscanner.c
--- a/sys/dev/usb/usscanner.c   Fri Apr 29 17:18:30 2005 +0000
+++ b/sys/dev/usb/usscanner.c   Fri Apr 29 17:52:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usscanner.c,v 1.15 2005/02/21 00:29:08 thorpej Exp $   */
+/*     $NetBSD: usscanner.c,v 1.16 2005/04/29 17:52:46 augustss Exp $  */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -54,8 +54,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usscanner.c,v 1.15 2005/02/21 00:29:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usscanner.c,v 1.16 2005/04/29 17:52:46 augustss Exp $");
 
+#include "scsibus.h"
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -312,6 +313,7 @@
        sc->sc_adapter.adapt_max_periph = 1;
        sc->sc_adapter.adapt_minphys = usscanner_scsipi_minphys;
 
+#if NSCSIBUS > 0
        /*
         * fill in the scsipi_channel.
         */
@@ -330,6 +332,13 @@
        DPRINTFN(10, ("usscanner_attach: %p\n", sc->sc_udev));
 
        USB_ATTACH_SUCCESS_RETURN;
+
+#else
+       /* No SCSI bus, just ignore it */
+       usscanner_cleanup(sc);
+       USB_ATTACH_ERROR_RETURN;
+
+#endif
 }
 
 USB_DETACH(usscanner)



Home | Main Index | Thread Index | Old Index