diff options
author | Mike Rapoport <mike.rapoport@gmail.com> | 2015-09-03 08:13:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-12 18:24:36 -0700 |
commit | 6d657dac56438bf7ade5a05142a633e7f5e43984 (patch) | |
tree | 59f729d23d08827329b87237a957fc21d869bbb1 /drivers/staging/fbtft/fb_watterott.c | |
parent | 23801e3438f6ceddf7db6d03c3556375d1001fda (diff) | |
download | linux-6d657dac56438bf7ade5a05142a633e7f5e43984.tar.gz linux-6d657dac56438bf7ade5a05142a633e7f5e43984.tar.bz2 linux-6d657dac56438bf7ade5a05142a633e7f5e43984.zip |
staging: fbtft: fb_watterott: define backlight_ops statically
instead of devm_kzalloc'ing them
Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fbtft/fb_watterott.c')
-rw-r--r-- | drivers/staging/fbtft/fb_watterott.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c index 33c21f108184..3000f75783a9 100644 --- a/drivers/staging/fbtft/fb_watterott.c +++ b/drivers/staging/fbtft/fb_watterott.c @@ -253,31 +253,24 @@ static int backlight_chip_update_status(struct backlight_device *bd) return 0; } +static const struct backlight_ops bl_ops = { + .update_status = backlight_chip_update_status, +}; + static void register_chip_backlight(struct fbtft_par *par) { struct backlight_device *bd; struct backlight_properties bl_props = { 0, }; - struct backlight_ops *bl_ops; fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s()\n", __func__); - bl_ops = devm_kzalloc(par->info->device, sizeof(struct backlight_ops), - GFP_KERNEL); - if (!bl_ops) { - dev_err(par->info->device, - "%s: could not allocate memory for backlight operations.\n", - __func__); - return; - } - - bl_ops->update_status = backlight_chip_update_status; bl_props.type = BACKLIGHT_RAW; bl_props.power = FB_BLANK_POWERDOWN; bl_props.max_brightness = 100; bl_props.brightness = DEFAULT_BRIGHTNESS; bd = backlight_device_register(dev_driver_string(par->info->device), - par->info->device, par, bl_ops, &bl_props); + par->info->device, par, &bl_ops, &bl_props); if (IS_ERR(bd)) { dev_err(par->info->device, "cannot register backlight device (%ld)\n", |