Date: Tue, 19 Mar 2019 14:30:54 +0000 (UTC) From: Michal Meloun <mmel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345295 - in head/sys/dev/extres: phy regulator syscon Message-ID: <201903191430.x2JEUsbR056231@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903191430.x2JEUsbR056231>