Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: rtsx: Simplify function return logic

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>

authored by

Javier Martinez Canillas and committed by
Lee Jones
b158b69a d8498df1

+5 -25
+1 -5
drivers/mfd/rts5209.c
··· 138 138 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_PWR_CTL, pwr_mask, pwr_on); 139 139 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, 140 140 LDO3318_PWR_MASK, 0x00); 141 - err = rtsx_pci_send_cmd(pcr, 100); 142 - if (err < 0) 143 - return err; 144 - 145 - return 0; 141 + return rtsx_pci_send_cmd(pcr, 100); 146 142 } 147 143 148 144 static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card)
+1 -5
drivers/mfd/rts5227.c
··· 179 179 SD_POWER_MASK, SD_POWER_ON); 180 180 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, 181 181 LDO3318_PWR_MASK, 0x06); 182 - err = rtsx_pci_send_cmd(pcr, 100); 183 - if (err < 0) 184 - return err; 185 - 186 - return 0; 182 + return rtsx_pci_send_cmd(pcr, 100); 187 183 } 188 184 189 185 static int rts5227_card_power_off(struct rtsx_pcr *pcr, int card)
+1 -5
drivers/mfd/rts5229.c
··· 129 129 SD_POWER_MASK, SD_POWER_ON); 130 130 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, 131 131 LDO3318_PWR_MASK, 0x06); 132 - err = rtsx_pci_send_cmd(pcr, 100); 133 - if (err < 0) 134 - return err; 135 - 136 - return 0; 132 + return rtsx_pci_send_cmd(pcr, 100); 137 133 } 138 134 139 135 static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card)
+1 -5
drivers/mfd/rts5249.c
··· 234 234 SD_POWER_MASK, SD_VCC_POWER_ON); 235 235 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL, 236 236 LDO3318_PWR_MASK, 0x06); 237 - err = rtsx_pci_send_cmd(pcr, 100); 238 - if (err < 0) 239 - return err; 240 - 241 - return 0; 237 + return rtsx_pci_send_cmd(pcr, 100); 242 238 } 243 239 244 240 static int rtsx_base_card_power_off(struct rtsx_pcr *pcr, int card)
+1 -5
drivers/mfd/rtsx_pcr.c
··· 571 571 tbl++; 572 572 } 573 573 574 - err = rtsx_pci_send_cmd(pcr, 100); 575 - if (err < 0) 576 - return err; 577 - 578 - return 0; 574 + return rtsx_pci_send_cmd(pcr, 100); 579 575 } 580 576 581 577 int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card)