mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
ofw: bool-ify OF_hasprop()
Adjust the function signature and the few callers that don't treat it this way already. This is style only; no functional change intended. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56203
This commit is contained in:
1 parent
8a5601cff1
commit
b60cd486a6
5 files changed
+9
-9
No files matched your search
@@ -157,7 +157,7 @@ clk_fixed_probe(device_t dev)
|
||||
clk_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
|
||||
switch (clk_type) {
|
||||
case CLK_TYPE_FIXED:
|
||||
if (OF_hasprop(ofw_bus_get_node(dev), "clock-frequency") == 0) {
|
||||
if (!OF_hasprop(ofw_bus_get_node(dev), "clock-frequency")) {
|
||||
device_printf(dev,
|
||||
"clock-fixed has no clock-frequency\n");
|
||||
return (ENXIO);
|
||||
|
||||
@@ -527,13 +527,13 @@ dwc_attach(device_t dev)
|
||||
sc->txpbl = pbl;
|
||||
if (OF_getencprop(sc->node, "snps,rxpbl", &sc->rxpbl, sizeof(uint32_t)) <= 0)
|
||||
sc->rxpbl = pbl;
|
||||
if (OF_hasprop(sc->node, "snps,no-pbl-x8") == 1)
|
||||
if (OF_hasprop(sc->node, "snps,no-pbl-x8"))
|
||||
sc->nopblx8 = true;
|
||||
if (OF_hasprop(sc->node, "snps,fixed-burst") == 1)
|
||||
if (OF_hasprop(sc->node, "snps,fixed-burst"))
|
||||
sc->fixed_burst = true;
|
||||
if (OF_hasprop(sc->node, "snps,mixed-burst") == 1)
|
||||
if (OF_hasprop(sc->node, "snps,mixed-burst"))
|
||||
sc->mixed_burst = true;
|
||||
if (OF_hasprop(sc->node, "snps,aal") == 1)
|
||||
if (OF_hasprop(sc->node, "snps,aal"))
|
||||
sc->aal = true;
|
||||
|
||||
error = clk_set_assigned(dev, ofw_bus_get_node(dev));
|
||||
|
||||
@@ -381,11 +381,11 @@ OF_getproplen(phandle_t package, const char *propname)
|
||||
}
|
||||
|
||||
/* Check existence of a property of a package. */
|
||||
int
|
||||
bool
|
||||
OF_hasprop(phandle_t package, const char *propname)
|
||||
{
|
||||
|
||||
return (OF_getproplen(package, propname) >= 0 ? 1 : 0);
|
||||
return (OF_getproplen(package, propname) >= 0);
|
||||
}
|
||||
|
||||
/* Get the value of a property of a package. */
|
||||
|
||||
@@ -108,7 +108,7 @@ ssize_t OF_getprop(phandle_t node, const char *propname, void *buf,
|
||||
size_t len);
|
||||
ssize_t OF_getencprop(phandle_t node, const char *prop, pcell_t *buf,
|
||||
size_t len); /* Same as getprop, but maintains endianness */
|
||||
int OF_hasprop(phandle_t node, const char *propname);
|
||||
bool OF_hasprop(phandle_t node, const char *propname);
|
||||
ssize_t OF_searchprop(phandle_t node, const char *propname, void *buf,
|
||||
size_t len);
|
||||
ssize_t OF_searchencprop(phandle_t node, const char *propname,
|
||||
|
||||
@@ -1585,7 +1585,7 @@ smsc_bootargs_get_mac_addr(device_t dev, struct usb_ether *ue)
|
||||
node = OF_finddevice("/chosen");
|
||||
if (node == -1)
|
||||
return (false);
|
||||
if (OF_hasprop(node, "bootargs") == 0) {
|
||||
if (!OF_hasprop(node, "bootargs")) {
|
||||
smsc_dbg_printf((struct smsc_softc *)ue->ue_sc,
|
||||
"bootargs not found");
|
||||
return (false);
|
||||
|
||||
Reference in new issue
Block a user