diff options
| author | tsutsui <tsutsui@NetBSD.org> | 2010-08-25 12:43:56 +0000 |
|---|---|---|
| committer | tsutsui <tsutsui@NetBSD.org> | 2010-08-25 12:43:56 +0000 |
| commit | cd398ae4e95eb00f398a982afd79724394546d16 (patch) | |
| tree | c722a11376e8bb2ad752858db3c0c296f705af19 /sys/dev | |
| parent | a18d4c5a69f18c6706ec8ee5bab9cd7a255f0dd9 (diff) | |
If firmware_load() returns ENOENT (i.e. No such file or directory),
explicitly mention that firmware file is not in the default distribution.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/if_upgt.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index 975a164b51d..fdd8d4deca0 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_upgt.c,v 1.2 2010/07/05 14:27:26 tsutsui Exp $ */ +/* $NetBSD: if_upgt.c,v 1.3 2010/08/25 12:43:56 tsutsui Exp $ */ /* $OpenBSD: if_upgt.c,v 1.49 2010/04/20 22:05:43 tedu Exp $ */ /* @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_upgt.c,v 1.2 2010/07/05 14:27:26 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_upgt.c,v 1.3 2010/08/25 12:43:56 tsutsui Exp $"); #include <sys/param.h> #include <sys/callout.h> @@ -664,10 +664,26 @@ upgt_fw_alloc(struct upgt_softc *sc) error = firmware_load("upgt", name, &sc->sc_fw, &sc->sc_fw_size); if (error != 0) { - aprint_error_dev(sc->sc_dev, - "could not read firmware %s\n", name); - aprint_error_dev(sc->sc_dev, - "see upgt(4) man page for details\n"); + if (error == ENOENT) { + /* + * The firmware file for upgt(4) is not in + * the default distribution due to its lisence + * so explicitly notify it if the firmware file + * is not found. + */ + aprint_error_dev(sc->sc_dev, + "firmware file %s is not installed\n", + name); + aprint_error_dev(sc->sc_dev, + "(it is not included in the default" + " distribution)\n"); + aprint_error_dev(sc->sc_dev, + "see upgt(4) man page for details about " + "firmware installation\n"); + } else { + aprint_error_dev(sc->sc_dev, + "could not read firmware %s\n", name); + } return EIO; } } |
