From owner-svn-src-head@freebsd.org Sat Apr 7 14:17:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AF4FF8BBF7; Sat, 7 Apr 2018 14:17:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BEEF79603; Sat, 7 Apr 2018 14:17:18 +0000 (UTC) (envelope-from manu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EC8621DF1; Sat, 7 Apr 2018 14:17:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EHIVo095738; Sat, 7 Apr 2018 14:17:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EHIae095737; Sat, 7 Apr 2018 14:17:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804071417.w37EHIae095737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 7 Apr 2018 14:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332166 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 332166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2018 14:17:18 -0000 Author: manu Date: Sat Apr 7 14:17:17 2018 New Revision: 332166 URL: https://svnweb.freebsd.org/changeset/base/332166 Log: axp81x: Do not fail if regulators aren't properly defined If a regulator is missing a mandatory property (like 'regulator-name'), do not fail, regulator_parse_ofw_stdparam is returning a non-zero value so just skip this regulator. Also if any regulator fails to attach continue with the rest of the regulators instead of returning ENXIO in axp8xx_attach Tested On: BananaPi M3 Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Sat Apr 7 09:03:51 2018 (r332165) +++ head/sys/arm/allwinner/axp81x.c Sat Apr 7 14:17:17 2018 (r332166) @@ -900,7 +900,8 @@ axp8xx_reg_attach(device_t dev, phandle_t node, struct regnode *regnode; memset(&initdef, 0, sizeof(initdef)); - regulator_parse_ofw_stdparam(dev, node, &initdef); + if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) + return (NULL); if (initdef.std_param.min_uvolt == 0) initdef.std_param.min_uvolt = def->voltage_min * 1000; if (initdef.std_param.max_uvolt == 0) @@ -1039,7 +1040,7 @@ axp8xx_attach(device_t dev) device_printf(dev, "cannot attach regulator %s\n", regname); - return (ENXIO); + continue; } sc->regs[i] = reg; }