diff options
author | mav <mav@FreeBSD.org> | 2015-10-22 15:13:47 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-22 15:13:47 +0000 |
commit | 0c3c20c6f906a765398669de7ce0a16a263d1950 (patch) | |
tree | c037e55ed6438adc378a6fc6125bd82350076cbd /sys/dev/ispfw/ispfw.c | |
parent | 783dc8a621296369c8e53e23f3d327950942d567 (diff) | |
download | FreeBSD-src-0c3c20c6f906a765398669de7ce0a16a263d1950.zip FreeBSD-src-0c3c20c6f906a765398669de7ce0a16a263d1950.tar.gz |
Remove residual verbosity.
firmware_register() already reports errors.
Diffstat (limited to 'sys/dev/ispfw/ispfw.c')
-rw-r--r-- | sys/dev/ispfw/ispfw.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/sys/dev/ispfw/ispfw.c b/sys/dev/ispfw/ispfw.c index 6da0769..f0e2599 100644 --- a/sys/dev/ispfw/ispfw.c +++ b/sys/dev/ispfw/ispfw.c @@ -135,43 +135,27 @@ static int isp_2500_loaded; #define ISPFW_VERSION 1 -#if !defined(KLD_MODULE) -#define ISPFW_KLD 0 -#else -#define ISPFW_KLD 1 -#endif - #define RMACRO(token) do { \ if (token##_loaded) \ break; \ if (firmware_register(#token, token##_risc_code, \ token##_risc_code[3] * sizeof(token##_risc_code[3]), \ - ISPFW_VERSION, NULL) == NULL) { \ - printf("%s: unable to register firmware <%s>\n", \ - MODULE_NAME, #token); \ + ISPFW_VERSION, NULL) == NULL) \ break; \ - } \ token##_loaded++; \ - if (bootverbose || ISPFW_KLD) \ - printf("%s: registered firmware <%s>\n", MODULE_NAME, \ - #token); \ } while (0) #define UMACRO(token) do { \ if (!token##_loaded) \ break; \ if (firmware_unregister(#token) != 0) { \ - printf("%s: unable to unregister firmware <%s>\n", \ - MODULE_NAME, #token); \ + error = EBUSY; \ break; \ } \ token##_loaded--; \ - if (bootverbose || ISPFW_KLD) \ - printf("%s: unregistered firmware <%s>\n", MODULE_NAME, \ - #token); \ } while (0) -static void +static int do_load_fw(void) { @@ -214,11 +198,13 @@ do_load_fw(void) #if defined(ISP_2500) RMACRO(isp_2500); #endif + return (0); } -static void +static int do_unload_fw(void) { + int error = 0; #if defined(ISP_1000) UMACRO(isp_1000); @@ -259,6 +245,7 @@ do_unload_fw(void) #if defined(ISP_2500) UMACRO(isp_2500); #endif + return (error); } static int @@ -267,17 +254,11 @@ module_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: - do_load_fw(); - break; + return (do_load_fw()); case MOD_UNLOAD: - do_unload_fw(); - break; - case MOD_SHUTDOWN: - break; - default: - return (EOPNOTSUPP); + return (do_unload_fw()); } - return (0); + return (EOPNOTSUPP); } static moduledata_t ispfw_mod = { MODULE_NAME, module_handler, NULL |