svn commit: r345295 - in head/sys/dev/extres: phy regulator syscon

Michal Meloun mmel at FreeBSD.org
Tue Mar 19 14:30:55 UTC 2019


Author: mmel
Date: Tue Mar 19 14:30:54 2019
New Revision: 345295
URL: https://svnweb.freebsd.org/changeset/base/345295

Log:
  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
  
  MFC after:	2 weeks

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

Modified: head/sys/dev/extres/phy/phy.c
==============================================================================
--- head/sys/dev/extres/phy/phy.c	Tue Mar 19 11:16:42 2019	(r345294)
+++ head/sys/dev/extres/phy/phy.c	Tue Mar 19 14:30:54 2019	(r345295)
@@ -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: head/sys/dev/extres/regulator/regulator.c
==============================================================================
--- head/sys/dev/extres/regulator/regulator.c	Tue Mar 19 11:16:42 2019	(r345294)
+++ head/sys/dev/extres/regulator/regulator.c	Tue Mar 19 14:30:54 2019	(r345295)
@@ -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: head/sys/dev/extres/syscon/syscon.c
==============================================================================
--- head/sys/dev/extres/syscon/syscon.c	Tue Mar 19 11:16:42 2019	(r345294)
+++ head/sys/dev/extres/syscon/syscon.c	Tue Mar 19 14:30:54 2019	(r345295)
@@ -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