From a2e87fee55c2024c7d9ad7c26614300effd48d4c Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 8 Mar 2018 15:15:51 +0100 Subject: mfd: ti_am335x_tscadc: Delete an error message for a failed memory allocation in ti_tscadc_probe() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Lee Jones --- drivers/mfd/ti_am335x_tscadc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/mfd/ti_am335x_tscadc.c') diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index 3cd958a31f36..47012c0899cd 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c @@ -169,10 +169,9 @@ static int ti_tscadc_probe(struct platform_device *pdev) /* Allocate memory for device */ tscadc = devm_kzalloc(&pdev->dev, sizeof(*tscadc), GFP_KERNEL); - if (!tscadc) { - dev_err(&pdev->dev, "failed to allocate memory.\n"); + if (!tscadc) return -ENOMEM; - } + tscadc->dev = &pdev->dev; err = platform_get_irq(pdev, 0); -- cgit v1.2.3