Logging messages that show some type of "out of memory" error are generally
unnecessary as there is a generic message and a stack dump done by the
memory subsystem. These messages generally increase kernel size without
much added value[1].
The dev_err_probe() doesn't do anything when error is '-ENOMEM'. Therefore,
remove the useless call to dev_err_probe(), and just return the value
instead.
[1]: https://lore.kernel.org/lkml/1402419340.30479.18.camel@joe-AO725/
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
drivers/bus/imx-aipstz.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/bus/imx-aipstz.c b/drivers/bus/imx-aipstz.c
index 5fdf377f5d06..b0f1445c4110 100644
--- a/drivers/bus/imx-aipstz.c
+++ b/drivers/bus/imx-aipstz.c
@@ -37,13 +37,11 @@ static int imx_aipstz_probe(struct platform_device *pdev)
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
- return dev_err_probe(&pdev->dev, -ENOMEM,
- "failed to allocate data memory\n");
+ return -ENOMEM;
data->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
if (IS_ERR(data->base))
- return dev_err_probe(&pdev->dev, -ENOMEM,
- "failed to get/ioremap AC memory\n");
+ return -ENOMEM;
data->default_cfg = of_device_get_match_data(&pdev->dev);
--
2.34.1