greybus: arche-apb: Drop unnecessary checks
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 11 Jan 2016 05:59:16 +0000 (11:29 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 11 Jan 2016 23:58:01 +0000 (15:58 -0800)
wake_detect_gpio and resetn_gpio are guaranteed to be valid in
apb_ctrl_cleanup() and irq-handler, no need to check for their validity.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/arche-apb-ctrl.c

index 859d22e3f149d0648ec9560f8ccd4cf47c66016c..04c44675926eace1e1365237c9b492215808bdfa 100644 (file)
@@ -94,10 +94,6 @@ static irqreturn_t apb_ctrl_wake_detect_irq(int irq, void *devid)
         * signals, especially when we start using GPIOs over slow
         * buses like I2C.
         */
-       if (!gpio_is_valid(apb->wake_detect_gpio) &&
-                       !gpio_is_valid(apb->resetn_gpio))
-               return IRQ_HANDLED; /* Should it be IRQ_NONE ?? */
-
        spin_lock_irqsave(&apb->lock, flags);
 
        if (apb->state != APB_STATE_ACTIVE) {
@@ -293,9 +289,7 @@ static void apb_ctrl_cleanup(struct arche_apb_ctrl_drvdata *apb)
 
        spin_lock_irqsave(&apb->lock, flags);
        /* As part of exit, put APB back in reset state */
-       if (gpio_is_valid(apb->resetn_gpio))
-               gpio_set_value(apb->resetn_gpio, 0);
-
+       gpio_set_value(apb->resetn_gpio, 0);
        apb->state = APB_STATE_OFF;
        spin_unlock_irqrestore(&apb->lock, flags);