staging: dwc2: rename dwc2_check_core_status()
authorPaul Zimmerman <Paul.Zimmerman@synopsys.com>
Sat, 23 Nov 2013 00:43:51 +0000 (16:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2013 19:59:58 +0000 (11:59 -0800)
Rename dwc2_check_core_status() to dwc2_is_controller_alive(), and
make it a boolean function. Also change the message when the
controller is dead to say "dead" instead of "disconnected".

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dwc2/core.c
drivers/staging/dwc2/core.h
drivers/staging/dwc2/core_intr.c
drivers/staging/dwc2/hcd_intr.c

index 07b397412825c4544ed40d16558c393eadffbfc7..c0b122a67996a2945df03009a98950148d367493 100644 (file)
@@ -2736,12 +2736,12 @@ u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg)
        return hsotg->core_params->otg_ver == 1 ? 0x0200 : 0x0103;
 }
 
-int dwc2_check_core_status(struct dwc2_hsotg *hsotg)
+bool dwc2_is_controller_alive(struct dwc2_hsotg *hsotg)
 {
        if (readl(hsotg->regs + GSNPSID) == 0xffffffff)
-               return -1;
+               return false;
        else
-               return 0;
+               return true;
 }
 
 /**
index 6a1c09f2f493fff6907c19a1f48397ec31bbb4bf..648519c024b533c72dba9d0ff5dc28f29b9a174e 100644 (file)
@@ -544,7 +544,7 @@ extern void dwc2_enable_host_interrupts(struct dwc2_hsotg *hsotg);
 extern void dwc2_disable_host_interrupts(struct dwc2_hsotg *hsotg);
 
 extern u32 dwc2_calc_frame_interval(struct dwc2_hsotg *hsotg);
-extern int dwc2_check_core_status(struct dwc2_hsotg *hsotg);
+extern bool dwc2_is_controller_alive(struct dwc2_hsotg *hsotg);
 
 /*
  * Common core Functions.
index 07cfa2f6aa2ba7ea56a174df106263c58bd4f80e..c78bb5d74045251405bcfb2ae2e6b03913966d49 100644 (file)
@@ -451,8 +451,8 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev)
        u32 gintsts;
        irqreturn_t retval = IRQ_NONE;
 
-       if (dwc2_check_core_status(hsotg) < 0) {
-               dev_warn(hsotg->dev, "Controller is disconnected\n");
+       if (!dwc2_is_controller_alive(hsotg)) {
+               dev_warn(hsotg->dev, "Controller is dead\n");
                goto out;
        }
 
index dda18540f5a7f306b3b003cd9b47f7e0b7c87c05..e672e6db2943fdb2f904f6e8b31c27d1cd92fea1 100644 (file)
@@ -2059,8 +2059,8 @@ irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg)
        u32 gintsts, dbg_gintsts;
        irqreturn_t retval = IRQ_NONE;
 
-       if (dwc2_check_core_status(hsotg) < 0) {
-               dev_warn(hsotg->dev, "Controller is disconnected\n");
+       if (!dwc2_is_controller_alive(hsotg) < 0) {
+               dev_warn(hsotg->dev, "Controller is dead\n");
                return retval;
        }