Remove the redundant assignments after registering the device and use a designated initializer for the backlight properties instead of assigning them separately.
Signed-off-by: Thorsten Blum <[email protected]> --- drivers/video/backlight/da9052_bl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c index 406c12434c44..f512b96cc500 100644 --- a/drivers/video/backlight/da9052_bl.c +++ b/drivers/video/backlight/da9052_bl.c @@ -104,7 +104,11 @@ static const struct backlight_ops da9052_backlight_ops = { static int da9052_backlight_probe(struct platform_device *pdev) { struct backlight_device *bl; - struct backlight_properties props; + struct backlight_properties props = { + .type = BACKLIGHT_RAW, + .max_brightness = DA9052_MAX_BRIGHTNESS, + .brightness = 0, + }; struct da9052_bl *wleds; wleds = devm_kzalloc_obj(&pdev->dev, struct da9052_bl); @@ -116,10 +120,6 @@ static int da9052_backlight_probe(struct platform_device *pdev) wleds->led_reg = platform_get_device_id(pdev)->driver_data; wleds->state = DA9052_WLEDS_OFF; - memset(&props, 0, sizeof(struct backlight_properties)); - props.type = BACKLIGHT_RAW; - props.max_brightness = DA9052_MAX_BRIGHTNESS; - bl = devm_backlight_device_register(&pdev->dev, pdev->name, wleds->da9052->dev, wleds, &da9052_backlight_ops, &props); @@ -128,8 +128,6 @@ static int da9052_backlight_probe(struct platform_device *pdev) return PTR_ERR(bl); } - bl->props.max_brightness = DA9052_MAX_BRIGHTNESS; - bl->props.brightness = 0; platform_set_drvdata(pdev, bl); return da9052_adjust_wled_brightness(wleds);
