diff options
Diffstat (limited to 'arch/arm/mach-s3c64xx/dev-backlight.c')
-rw-r--r-- | arch/arm/mach-s3c64xx/dev-backlight.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c index e62e789f9aee..799cfdf0606b 100644 --- a/arch/arm/mach-s3c64xx/dev-backlight.c +++ b/arch/arm/mach-s3c64xx/dev-backlight.c @@ -1,13 +1,9 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd. - * http://www.samsung.com - * - * Common infrastructure for PWM Backlight for Samsung boards - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (c) 2011 Samsung Electronics Co., Ltd. +// http://www.samsung.com +// +// Common infrastructure for PWM Backlight for Samsung boards #include <linux/gpio.h> #include <linux/platform_device.h> @@ -94,17 +90,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; @@ -144,5 +137,4 @@ err_plat_reg2: kfree(samsung_bl_data); err_data: kfree(samsung_bl_device); - return; } |