Commit 6f6536a0 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Miquel Raynal

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220607152458.232847-5-u.kleine-koenig@pengutronix.de
parent cd043c61
...@@ -2084,15 +2084,12 @@ static int stfsm_probe(struct platform_device *pdev) ...@@ -2084,15 +2084,12 @@ static int stfsm_probe(struct platform_device *pdev)
* Configure READ/WRITE/ERASE sequences according to platform and * Configure READ/WRITE/ERASE sequences according to platform and
* device flags. * device flags.
*/ */
if (info->config) { if (info->config)
ret = info->config(fsm); ret = info->config(fsm);
if (ret) else
goto err_clk_unprepare;
} else {
ret = stfsm_prepare_rwe_seqs_default(fsm); ret = stfsm_prepare_rwe_seqs_default(fsm);
if (ret) if (ret)
goto err_clk_unprepare; goto err_clk_unprepare;
}
fsm->mtd.name = info->name; fsm->mtd.name = info->name;
fsm->mtd.dev.parent = &pdev->dev; fsm->mtd.dev.parent = &pdev->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment