aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/extres
diff options
context:
space:
mode:
authorMichal Meloun <mmel@FreeBSD.org>2019-03-19 14:30:54 +0000
committerMichal Meloun <mmel@FreeBSD.org>2019-03-19 14:30:54 +0000
commit2dd13cf6a46c92439ca0a30ce1df496dd3989030 (patch)
tree0a9ceb9538ce6d1f7b93ede8eaf46043faad327a /sys/dev/extres
parent9883abca1f3ae2a8995edfdec070829306fb91d7 (diff)
downloadsrc-2dd13cf6a46c92439ca0a30ce1df496dd3989030.tar.gz
src-2dd13cf6a46c92439ca0a30ce1df496dd3989030.zip
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
Notes
Notes: svn path=/head/; revision=345295
Diffstat (limited to 'sys/dev/extres')
-rw-r--r--sys/dev/extres/phy/phy.c2
-rw-r--r--sys/dev/extres/regulator/regulator.c2
-rw-r--r--sys/dev/extres/syscon/syscon.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/extres/phy/phy.c b/sys/dev/extres/phy/phy.c
index ac1feebf0425..0d61ac4827c2 100644
--- a/sys/dev/extres/phy/phy.c
+++ b/sys/dev/extres/phy/phy.c
@@ -517,7 +517,7 @@ phy_get_by_ofw_property(device_t consumer_dev, phandle_t cnode, char *name,
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]);
diff --git a/sys/dev/extres/regulator/regulator.c b/sys/dev/extres/regulator/regulator.c
index 079612a46957..ba4af0771212 100644
--- a/sys/dev/extres/regulator/regulator.c
+++ b/sys/dev/extres/regulator/regulator.c
@@ -1091,7 +1091,7 @@ regulator_get_by_ofw_property(device_t cdev, phandle_t cnode, char *name,
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]);
diff --git a/sys/dev/extres/syscon/syscon.c b/sys/dev/extres/syscon/syscon.c
index d0b440c9cc9a..d2d87e6e53b7 100644
--- a/sys/dev/extres/syscon/syscon.c
+++ b/sys/dev/extres/syscon/syscon.c
@@ -238,7 +238,7 @@ syscon_get_by_ofw_property(device_t cdev, phandle_t cnode, char *name,
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();