Skip to content

Commit b158b69

Browse files
Javier Martinez CanillasLee Jones
authored andcommitted
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>
1 parent d8498df commit b158b69

5 files changed

Lines changed: 5 additions & 25 deletions

File tree

‎drivers/mfd/rts5209.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,7 @@ static int rts5209_card_power_on(struct rtsx_pcr *pcr, int card)
138138
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_PWR_CTL, pwr_mask, pwr_on);
139139
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
140140
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);
146142
}
147143

148144
static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card)

‎drivers/mfd/rts5227.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,7 @@ static int rts5227_card_power_on(struct rtsx_pcr *pcr, int card)
179179
SD_POWER_MASK, SD_POWER_ON);
180180
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
181181
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);
187183
}
188184

189185
static int rts5227_card_power_off(struct rtsx_pcr *pcr, int card)

‎drivers/mfd/rts5229.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,7 @@ static int rts5229_card_power_on(struct rtsx_pcr *pcr, int card)
129129
SD_POWER_MASK, SD_POWER_ON);
130130
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
131131
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);
137133
}
138134

139135
static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card)

‎drivers/mfd/rts5249.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,7 @@ static int rtsx_base_card_power_on(struct rtsx_pcr *pcr, int card)
234234
SD_POWER_MASK, SD_VCC_POWER_ON);
235235
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PWR_GATE_CTRL,
236236
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);
242238
}
243239

244240
static int rtsx_base_card_power_off(struct rtsx_pcr *pcr, int card)

‎drivers/mfd/rtsx_pcr.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,7 @@ static int rtsx_pci_set_pull_ctl(struct rtsx_pcr *pcr, const u32 *tbl)
571571
tbl++;
572572
}
573573

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);
579575
}
580576

581577
int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card)

0 commit comments

Comments
 (0)