svn commit: r350821 - in stable/12/sys/dev/extres: phy regulator syscon

Michal Meloun mmel at FreeBSD.org
Fri Aug 9 10:33:24 UTC 2019


Author: mmel
Date: Fri Aug  9 10:33:23 2019
New Revision: 350821
URL: https://svnweb.freebsd.org/changeset/base/350821

Log:
  MFC r345295:
  
    extres: Unify error codes for <foo>_get_by_ofw_property() methods.  Return:
     - ENOENT if requested property doesn't exist - ENODEV if producer device is
     not (yet) attached - ENXIO otherwise

Modified:
  stable/12/sys/dev/extres/phy/phy.c
  stable/12/sys/dev/extres/regulator/regulator.c
  stable/12/sys/dev/extres/syscon/syscon.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/extres/phy/phy.c
==============================================================================
--- stable/12/sys/dev/extres/phy/phy.c	Fri Aug  9 10:31:53 2019	(r350820)
+++ stable/12/sys/dev/extres/phy/phy.c	Fri Aug  9 10:33:23 2019	(r350821)
@@ -517,7 +517,7 @@ phy_get_by_ofw_property(device_t consumer_dev, phandle
 	ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t),
 	    (void **)&cells);
 	if (ncells < 1)
-		return (ENXIO);
+		return (ENOENT);
 
 	/* Tranlate provider to device. */
 	phydev = OF_device_from_xref(cells[0]);

Modified: stable/12/sys/dev/extres/regulator/regulator.c
==============================================================================
--- stable/12/sys/dev/extres/regulator/regulator.c	Fri Aug  9 10:31:53 2019	(r350820)
+++ stable/12/sys/dev/extres/regulator/regulator.c	Fri Aug  9 10:33:23 2019	(r350821)
@@ -1091,7 +1091,7 @@ regulator_get_by_ofw_property(device_t cdev, phandle_t
 	ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(*cells),
 	    (void **)&cells);
 	if (ncells <= 0)
-		return (ENXIO);
+		return (ENOENT);
 
 	/* Translate xref to device */
 	regdev = OF_device_from_xref(cells[0]);

Modified: stable/12/sys/dev/extres/syscon/syscon.c
==============================================================================
--- stable/12/sys/dev/extres/syscon/syscon.c	Fri Aug  9 10:31:53 2019	(r350820)
+++ stable/12/sys/dev/extres/syscon/syscon.c	Fri Aug  9 10:33:23 2019	(r350821)
@@ -238,7 +238,7 @@ syscon_get_by_ofw_property(device_t cdev, phandle_t cn
 	ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t),
 	    (void **)&cells);
 	if (ncells < 1)
-		return (ENXIO);
+		return (ENOENT);
 
 	/* Translate to syscon node. */
 	SYSCON_TOPO_SLOCK();


More information about the svn-src-all mailing list