ASoC: rsnd: Delete an error message for a failed memory allocation in three functions
Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
b6e58fcacb
commit
0d7820d091
@@ -586,10 +586,8 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL);
|
adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL);
|
||||||
if (!adg) {
|
if (!adg)
|
||||||
dev_err(dev, "ADG allocate failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
ret = rsnd_mod_init(priv, &adg->mod, &adg_ops,
|
ret = rsnd_mod_init(priv, &adg->mod, &adg_ops,
|
||||||
NULL, NULL, 0, 0);
|
NULL, NULL, 0, 0);
|
||||||
|
@@ -1401,10 +1401,8 @@ static int rsnd_probe(struct platform_device *pdev)
|
|||||||
* init priv data
|
* init priv data
|
||||||
*/
|
*/
|
||||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||||
if (!priv) {
|
if (!priv)
|
||||||
dev_err(dev, "priv allocate failed\n");
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
|
||||||
|
|
||||||
priv->pdev = pdev;
|
priv->pdev = pdev;
|
||||||
priv->flags = (unsigned long)of_device_get_match_data(dev);
|
priv->flags = (unsigned long)of_device_get_match_data(dev);
|
||||||
|
@@ -406,10 +406,8 @@ int rsnd_gen_probe(struct rsnd_priv *priv)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL);
|
gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL);
|
||||||
if (!gen) {
|
if (!gen)
|
||||||
dev_err(dev, "GEN allocate failed\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
priv->gen = gen;
|
priv->gen = gen;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user