mfd: rtsx: Simplify function return logic
authorJavier Martinez Canillas <javier@osg.samsung.com>
Tue, 29 Sep 2015 11:26:05 +0000 (13:26 +0200)
committerLee Jones <lee.jones@linaro.org>
Fri, 30 Oct 2015 17:19:44 +0000 (17:19 +0000)
The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/rts5209.c
drivers/mfd/rts5227.c
drivers/mfd/rts5229.c
drivers/mfd/rts5249.c
drivers/mfd/rtsx_pcr.c

index 373e253c33df945544a9c6ce6caac564d1647bbc..b95beecf767fffffbb06ca18c82dbd3f5aa18673 100644 (file)
@@ -138,11 +138,7 @@ static int rts5209_card_power_on(struct rtsx_pcr *pcr, int card)
        rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_PWR_CTL, pwr_mask, pwr_on);
        rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
                        LDO3318_PWR_MASK, 0x00);
-       err = rtsx_pci_send_cmd(pcr, 100);
-       if (err < 0)
-               return err;
-
-       return 0;
+       return rtsx_pci_send_cmd(pcr, 100);
 }
 
 static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card)
index ce012d78ce2a0fe45ac78e52c6d17bb0a91f8632..c5a65298c78101a23b6abf9763938ce6f64f29b8 100644 (file)
@@ -179,11 +179,7 @@ static int rts5227_card_power_on(struct rtsx_pcr *pcr, int card)
                        SD_POWER_MASK, SD_POWER_ON);
        rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
                        LDO3318_PWR_MASK, 0x06);
-       err = rtsx_pci_send_cmd(pcr, 100);
-       if (err < 0)
-               return err;
-
-       return 0;
+       return rtsx_pci_send_cmd(pcr, 100);
 }
 
 static int rts5227_card_power_off(struct rtsx_pcr *pcr, int card)
index ace45384ec8bc2893f9c1ff2bb4ea6cb027e2a23..9ed9dc84eac8b1a89324a89dd5a202fa1d3d9e7c 100644 (file)
@@ -129,11 +129,7 @@ static int rts5229_card_power_on(struct rtsx_pcr *pcr, int card)
                        SD_POWER_MASK, SD_POWER_ON);
        rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
                        LDO3318_PWR_MASK, 0x06);
-       err = rtsx_pci_send_cmd(pcr, 100);
-       if (err < 0)
-               return err;
-
-       return 0;
+       return rtsx_pci_send_cmd(pcr, 100);
 }
 
 static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card)
index eb2d5866f7195296999b5d9afb11ae2eb707d862..40f8bb14fc59720906a6ad4d2e65edc0b5c40d4e 100644 (file)
@@ -234,11 +234,7 @@ static int rtsx_base_card_power_on(struct rtsx_pcr *pcr, int card)
                        SD_POWER_MASK, SD_VCC_POWER_ON);
        rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
                        LDO3318_PWR_MASK, 0x06);
-       err = rtsx_pci_send_cmd(pcr, 100);
-       if (err < 0)
-               return err;
-
-       return 0;
+       return rtsx_pci_send_cmd(pcr, 100);
 }
 
 static int rtsx_base_card_power_off(struct rtsx_pcr *pcr, int card)
index a66540a4907995bfd7b0dec0e0511c7c090ac1b6..b98cf1de0a558ba721833228444ea73f7fd92e0f 100644 (file)
@@ -571,11 +571,7 @@ static int rtsx_pci_set_pull_ctl(struct rtsx_pcr *pcr, const u32 *tbl)
                tbl++;
        }
 
-       err = rtsx_pci_send_cmd(pcr, 100);
-       if (err < 0)
-               return err;
-
-       return 0;
+       return rtsx_pci_send_cmd(pcr, 100);
 }
 
 int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card)