Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2019 10:33:24 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r350821 - in stable/12/sys/dev/extres: phy regulator syscon
Message-ID:  <201908091033.x79AXOdZ087556@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908091033.x79AXOdZ087556>