NFC: trf7970a: Don't return value from trf7970a_switch_rf_on()
authorMark A. Greer <mgreer@animalcreek.com>
Tue, 25 Mar 2014 15:54:39 +0000 (08:54 -0700)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 21 Apr 2014 22:37:28 +0000 (00:37 +0200)
trf7970a_switch_rf_on() no longer returns anything other than 0 so make
it void and clean up the code that checks for errors when its called.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/trf7970a.c

index 26e744934068d9d502e22b760bdc31a3e470747a..8744a556fbd1e71b00ab4dbe5ed5cdb754a7a845 100644 (file)
@@ -804,21 +804,18 @@ static void trf7970a_switch_rf_off(struct trf7970a *trf)
        pm_runtime_put_autosuspend(trf->dev);
 }
 
-static int trf7970a_switch_rf_on(struct trf7970a *trf)
+static void trf7970a_switch_rf_on(struct trf7970a *trf)
 {
        dev_dbg(trf->dev, "Switching rf on\n");
 
        pm_runtime_get_sync(trf->dev);
 
        trf->state = TRF7970A_ST_IDLE;
-
-       return 0;
 }
 
 static int trf7970a_switch_rf(struct nfc_digital_dev *ddev, bool on)
 {
        struct trf7970a *trf = nfc_digital_get_drvdata(ddev);
-       int ret = 0;
 
        dev_dbg(trf->dev, "Switching RF - state: %d, on: %d\n", trf->state, on);
 
@@ -827,7 +824,7 @@ static int trf7970a_switch_rf(struct nfc_digital_dev *ddev, bool on)
        if (on) {
                switch (trf->state) {
                case TRF7970A_ST_OFF:
-                       ret = trf7970a_switch_rf_on(trf);
+                       trf7970a_switch_rf_on(trf);
                        break;
                case TRF7970A_ST_IDLE:
                case TRF7970A_ST_IDLE_RX_BLOCKED:
@@ -852,7 +849,7 @@ static int trf7970a_switch_rf(struct nfc_digital_dev *ddev, bool on)
        }
 
        mutex_unlock(&trf->lock);
-       return ret;
+       return 0;
 }
 
 static int trf7970a_config_rf_tech(struct trf7970a *trf, int tech)
@@ -943,17 +940,14 @@ static int trf7970a_in_configure_hw(struct nfc_digital_dev *ddev, int type,
                int param)
 {
        struct trf7970a *trf = nfc_digital_get_drvdata(ddev);
-       int ret = 0;
+       int ret;
 
        dev_dbg(trf->dev, "Configure hw - type: %d, param: %d\n", type, param);
 
        mutex_lock(&trf->lock);
 
-       if (trf->state == TRF7970A_ST_OFF) {
-               ret = trf7970a_switch_rf_on(trf);
-               if (ret)
-                       goto err_out;
-       }
+       if (trf->state == TRF7970A_ST_OFF)
+               trf7970a_switch_rf_on(trf);
 
        switch (type) {
        case NFC_DIGITAL_CONFIG_RF_TECH:
@@ -967,7 +961,6 @@ static int trf7970a_in_configure_hw(struct nfc_digital_dev *ddev, int type,
                ret = -EINVAL;
        }
 
-err_out:
        mutex_unlock(&trf->lock);
        return ret;
 }
This page took 0.027074 seconds and 5 git commands to generate.