aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/base.c
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2014-11-12 15:54:01 -0500
committerGrant Likely <grant.likely@linaro.org>2014-11-18 12:32:55 -0500
commit53a4ab96c61a34d62717b1481f6043e0b4338d74 (patch)
tree080fa624bc76f9d2f8b5816860713f500ae4e748 /drivers/of/base.c
parent25c7a1de6c4b9f9eb867af4dc9215bbf9e08ef2e (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/base.c')
-rw-r--r--drivers/of/base.c22
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);
522 * 522 *
523 * @device: Node to check for availability, with locks already held 523 * @device: Node to check for availability, with locks already held
524 * 524 *
525 * Returns 1 if the status property is absent or set to "okay" or "ok", 525 * Returns true if the status property is absent or set to "okay" or "ok",
526 * 0 otherwise 526 * false otherwise
527 */ 527 */
528static int __of_device_is_available(const struct device_node *device) 528static bool __of_device_is_available(const struct device_node *device)
529{ 529{
530 const char *status; 530 const char *status;
531 int statlen; 531 int statlen;
532 532
533 if (!device) 533 if (!device)
534 return 0; 534 return false;
535 535
536 status = __of_get_property(device, "status", &statlen); 536 status = __of_get_property(device, "status", &statlen);
537 if (status == NULL) 537 if (status == NULL)
538 return 1; 538 return true;
539 539
540 if (statlen > 0) { 540 if (statlen > 0) {
541 if (!strcmp(status, "okay") || !strcmp(status, "ok")) 541 if (!strcmp(status, "okay") || !strcmp(status, "ok"))
542 return 1; 542 return true;
543 } 543 }
544 544
545 return 0; 545 return false;
546} 546}
547 547
548/** 548/**
@@ -550,13 +550,13 @@ static int __of_device_is_available(const struct device_node *device)
550 * 550 *
551 * @device: Node to check for availability 551 * @device: Node to check for availability
552 * 552 *
553 * Returns 1 if the status property is absent or set to "okay" or "ok", 553 * Returns true if the status property is absent or set to "okay" or "ok",
554 * 0 otherwise 554 * false otherwise
555 */ 555 */
556int of_device_is_available(const struct device_node *device) 556bool of_device_is_available(const struct device_node *device)
557{ 557{
558 unsigned long flags; 558 unsigned long flags;
559 int res; 559 bool res;
560 560
561 raw_spin_lock_irqsave(&devtree_lock, flags); 561 raw_spin_lock_irqsave(&devtree_lock, flags);
562 res = __of_device_is_available(device); 562 res = __of_device_is_available(device);