Date: Sat, 7 Apr 2018 14:17:18 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332166 - head/sys/arm/allwinner Message-ID: <201804071417.w37EHIae095737@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804071417.w37EHIae095737>