ASoC: blackfin: Use common error handling code in sport_create()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Markus Elfring 2017-08-11 22:02:47 +02:00 committed by Mark Brown
parent 60ea0394a6
commit 11fca34b27

View File

@ -394,19 +394,18 @@ struct sport_device *sport_create(struct platform_device *pdev)
sport->pdev = pdev;
ret = sport_get_resource(sport);
if (ret) {
kfree(sport);
return NULL;
}
if (ret)
goto free_data;
ret = sport_request_resource(sport);
if (ret) {
kfree(sport);
return NULL;
}
if (ret)
goto free_data;
dev_dbg(dev, "SPORT create success\n");
return sport;
free_data:
kfree(sport);
return NULL;
}
EXPORT_SYMBOL(sport_create);