Date: Thu, 22 Oct 2015 15:13:48 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289755 - head/sys/dev/ispfw Message-ID: <201510221513.t9MFDm92029282@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Oct 22 15:13:47 2015 New Revision: 289755 URL: https://svnweb.freebsd.org/changeset/base/289755 Log: Remove residual verbosity. firmware_register() already reports errors. Modified: head/sys/dev/ispfw/ispfw.c Modified: head/sys/dev/ispfw/ispfw.c ============================================================================== --- head/sys/dev/ispfw/ispfw.c Thu Oct 22 14:29:19 2015 (r289754) +++ head/sys/dev/ispfw/ispfw.c Thu Oct 22 15:13:47 2015 (r289755) @@ -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, v 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510221513.t9MFDm92029282>