From owner-svn-src-all@freebsd.org Thu Oct 22 15:13:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 592B7A1A5EE; Thu, 22 Oct 2015 15:13:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC74124E; Thu, 22 Oct 2015 15:13:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9MFDm8S029283; Thu, 22 Oct 2015 15:13:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9MFDm92029282; Thu, 22 Oct 2015 15:13:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510221513.t9MFDm92029282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 22 Oct 2015 15:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289755 - head/sys/dev/ispfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2015 15:13:49 -0000 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