Skip to content

Commit 6f6536a

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: st_spi_fsm: Simplify error checking in .probe() a bit
Instead of ending each if branch with the same check, do it once unconditionally after the if block. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220607152458.232847-5-u.kleine-koenig@pengutronix.de
1 parent cd043c6 commit 6f6536a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/mtd/devices/st_spi_fsm.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,15 +2084,12 @@ static int stfsm_probe(struct platform_device *pdev)
20842084
* Configure READ/WRITE/ERASE sequences according to platform and
20852085
* device flags.
20862086
*/
2087-
if (info->config) {
2087+
if (info->config)
20882088
ret = info->config(fsm);
2089-
if (ret)
2090-
goto err_clk_unprepare;
2091-
} else {
2089+
else
20922090
ret = stfsm_prepare_rwe_seqs_default(fsm);
2093-
if (ret)
2094-
goto err_clk_unprepare;
2095-
}
2091+
if (ret)
2092+
goto err_clk_unprepare;
20962093

20972094
fsm->mtd.name = info->name;
20982095
fsm->mtd.dev.parent = &pdev->dev;

0 commit comments

Comments
 (0)