diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2014-11-12 12:54:01 -0800 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-11-18 17:32:55 +0000 |
commit | 53a4ab96c61a34d62717b1481f6043e0b4338d74 (patch) | |
tree | 080fa624bc76f9d2f8b5816860713f500ae4e748 /drivers/of | |
parent | 25c7a1de6c4b9f9eb867af4dc9215bbf9e08ef2e (diff) |
of: Change of_device_is_available() to return bool
This function can only return true or false; using a bool makes it more
obvious to the reader.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/base.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 4627e0acf4ad..2d5dfb8b2e65 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -522,27 +522,27 @@ EXPORT_SYMBOL(of_machine_is_compatible); * * @device: Node to check for availability, with locks already held * - * Returns 1 if the status property is absent or set to "okay" or "ok", - * 0 otherwise + * Returns true if the status property is absent or set to "okay" or "ok", + * false otherwise */ -static int __of_device_is_available(const struct device_node *device) +static bool __of_device_is_available(const struct device_node *device) { const char *status; int statlen; if (!device) - return 0; + return false; status = __of_get_property(device, "status", &statlen); if (status == NULL) - return 1; + return true; if (statlen > 0) { if (!strcmp(status, "okay") || !strcmp(status, "ok")) - return 1; + return true; } - return 0; + return false; } /** @@ -550,13 +550,13 @@ static int __of_device_is_available(const struct device_node *device) * * @device: Node to check for availability * - * Returns 1 if the status property is absent or set to "okay" or "ok", - * 0 otherwise + * Returns true if the status property is absent or set to "okay" or "ok", + * false otherwise */ -int of_device_is_available(const struct device_node *device) +bool of_device_is_available(const struct device_node *device) { unsigned long flags; - int res; + bool res; raw_spin_lock_irqsave(&devtree_lock, flags); res = __of_device_is_available(device); |