On Tue, 1 Aug 2023 at 07:23, Harshit MogalapalliThanks for the suggestion. Yes it would reduce many "gotos".
<harshit.m.mogalapalli@xxxxxxxxxx> wrote:
There are few issues in spmmc_drv_probe():
1. When mmc allocation fails, goto is a no-op.
2. When mmc allocation succeeds, the error paths should use goto instead
of direct return.
Rather than adding a bunch of new "gotos", how about converting into
using devm_mmc_alloc_host()?
(Also will split this into different patch as it's fixing a different thing than above.)3. platform_get_irq() doesn't return zero, so '<' is sufficient.
Fix the above issues by adding goto instead of direct return, also
remove NULL check in 'probe_free_host' as we changed the goto to return
when mmc_alloc_host() fails.
Fixes: 4e268fed8b18 ("mmc: Add mmc driver for Sunplus SP7021")
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/a3829ed3-d827-4b9d-827e-9cc24a3ec3bc@moroto.mountain/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
Other than the above, this looks good to me!
Kind regards
Uffe