svn commit: r356487 - head/sys/dev/extres/regulator

Emmanuel Vadot manu at FreeBSD.org
Wed Jan 8 11:30:43 UTC 2020


Author: manu
Date: Wed Jan  8 11:30:42 2020
New Revision: 356487
URL: https://svnweb.freebsd.org/changeset/base/356487

Log:
  regulator: fix regnode_method_get_voltage
  
  This method is supposed to write the voltage into uvolt
  and return an errno compatible value.
  
  Reviewed by:	mmel
  Differential Revision:	https://reviews.freebsd.org/D23006

Modified:
  head/sys/dev/extres/regulator/regulator.c

Modified: head/sys/dev/extres/regulator/regulator.c
==============================================================================
--- head/sys/dev/extres/regulator/regulator.c	Wed Jan  8 11:30:03 2020	(r356486)
+++ head/sys/dev/extres/regulator/regulator.c	Wed Jan  8 11:30:42 2020	(r356487)
@@ -275,8 +275,9 @@ static int
 regnode_method_get_voltage(struct regnode *regnode, int *uvolt)
 {
 
-	return (regnode->std_param.min_uvolt +
-	    (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2);
+	*uvolt = regnode->std_param.min_uvolt +
+	    (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2;
+	return (0);
 }
 
 int


More information about the svn-src-head mailing list