svn commit: r332166 - head/sys/arm/allwinner

Emmanuel Vadot manu at FreeBSD.org
Sat Apr 7 14:17:18 UTC 2018


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;
 		}


More information about the svn-src-all mailing list