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:
parent
60ea0394a6
commit
11fca34b27
|
@ -394,19 +394,18 @@ struct sport_device *sport_create(struct platform_device *pdev)
|
||||||
sport->pdev = pdev;
|
sport->pdev = pdev;
|
||||||
|
|
||||||
ret = sport_get_resource(sport);
|
ret = sport_get_resource(sport);
|
||||||
if (ret) {
|
if (ret)
|
||||||
kfree(sport);
|
goto free_data;
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = sport_request_resource(sport);
|
ret = sport_request_resource(sport);
|
||||||
if (ret) {
|
if (ret)
|
||||||
kfree(sport);
|
goto free_data;
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev_dbg(dev, "SPORT create success\n");
|
dev_dbg(dev, "SPORT create success\n");
|
||||||
return sport;
|
return sport;
|
||||||
|
free_data:
|
||||||
|
kfree(sport);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(sport_create);
|
EXPORT_SYMBOL(sport_create);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue