From owner-svn-src-projects@FreeBSD.ORG Sat Mar 16 16:47:10 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD72EC01; Sat, 16 Mar 2013 16:47:10 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB65A7CA; Sat, 16 Mar 2013 16:47:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2GGlAeA028336; Sat, 16 Mar 2013 16:47:10 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2GGlAOr028335; Sat, 16 Mar 2013 16:47:10 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201303161647.r2GGlAOr028335@svn.freebsd.org> From: Aleksandr Rybalko Date: Sat, 16 Mar 2013 16:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r248377 - projects/efika_mx/sys/arm/freescale/imx X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Mar 2013 16:47:10 -0000 Author: ray Date: Sat Mar 16 16:47:10 2013 New Revision: 248377 URL: http://svnweb.freebsd.org/changeset/base/248377 Log: o Protect iomux API calls with check if iomuxsc initialized. o Fix typo in comment. Sponsored by: The FreeBSD Foundation Modified: projects/efika_mx/sys/arm/freescale/imx/imx51_iomux.c Modified: projects/efika_mx/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- projects/efika_mx/sys/arm/freescale/imx/imx51_iomux.c Sat Mar 16 16:41:46 2013 (r248376) +++ projects/efika_mx/sys/arm/freescale/imx/imx51_iomux.c Sat Mar 16 16:47:10 2013 (r248377) @@ -128,7 +128,7 @@ iomux_attach(device_t dev) iomuxsc = sc; /* - * XXX: place to fetch all into about pinmuxing from loader data + * XXX: place to fetch all info about pinmuxing from loader data * (FDT blob) and apply. Loader (1st one) must care about * device-to-device difference. */ @@ -148,6 +148,9 @@ iomux_set_function_sub(struct iomux_soft void iomux_set_function(unsigned int pin, unsigned int fn) { + + if (iomuxsc == NULL) + return; iomux_set_function_sub(iomuxsc, pin, fn); } @@ -163,6 +166,9 @@ iomux_set_pad_sub(struct iomux_softc *sc void iomux_set_pad(unsigned int pin, unsigned int config) { + + if (iomuxsc == NULL) + return; iomux_set_pad_sub(iomuxsc, pin, config); } @@ -182,6 +188,8 @@ iomux_mux_config(const struct iomux_conf { int i; + if (iomuxsc == NULL) + return; for (i = 0; conflist[i].pin != IOMUX_CONF_EOT; i++) { iomux_set_pad_sub(iomuxsc, conflist[i].pin, conflist[i].pad); iomux_set_function_sub(iomuxsc, conflist[i].pin, @@ -195,6 +203,8 @@ iomux_input_config(const struct iomux_in { int i; + if (iomuxsc == NULL) + return; for (i = 0; conflist[i].inout != -1; i++) { iomux_set_inout(iomuxsc, conflist[i].inout, conflist[i].inout_mode);