From 9c1446c27f2487ce42790cf5b7f29e763789e85d Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Mon, 2 Oct 2017 22:20:39 +0200 Subject: ARM: s3c64xx: Remove printk for failed memory allocation in samsung_bl_set Omit an extra message for a memory allocation failure in samsung_bl_set(). This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c64xx/dev-backlight.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'arch/arm/mach-s3c64xx/dev-backlight.c') diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c index e62e789f9aee..7e2db762c442 100644 --- a/arch/arm/mach-s3c64xx/dev-backlight.c +++ b/arch/arm/mach-s3c64xx/dev-backlight.c @@ -94,17 +94,14 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, samsung_bl_device = kmemdup(&samsung_dfl_bl_device, sizeof(struct platform_device), GFP_KERNEL); - if (!samsung_bl_device) { - printk(KERN_ERR "%s: no memory for platform dev\n", __func__); + if (!samsung_bl_device) return; - } samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data, sizeof(samsung_dfl_bl_data), GFP_KERNEL); - if (!samsung_bl_drvdata) { - printk(KERN_ERR "%s: no memory for platform dev\n", __func__); + if (!samsung_bl_drvdata) goto err_data; - } + samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data; samsung_bl_drvdata->gpio_info = gpio_info; samsung_bl_data = &samsung_bl_drvdata->plat_data; -- cgit v1.2.3 From 0640357bf4f9a8b8c624c295bd0e001e5d0db5a9 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Mon, 2 Oct 2017 22:30:55 +0200 Subject: ARM: s3c64xx: Delete an unnecessary return statement in samsung_bl_set Fix checkpatch warning: WARNING: void function return statements are not generally useful Signed-off-by: Markus Elfring [krzk: Rewrite commit message] Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c64xx/dev-backlight.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-s3c64xx/dev-backlight.c') diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c index 7e2db762c442..7ef8b9019344 100644 --- a/arch/arm/mach-s3c64xx/dev-backlight.c +++ b/arch/arm/mach-s3c64xx/dev-backlight.c @@ -141,5 +141,4 @@ err_plat_reg2: kfree(samsung_bl_data); err_data: kfree(samsung_bl_device); - return; } -- cgit v1.2.3