Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1208266
| From | Mike Rapoport <mike.rapoport@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 5/5] staging: fbtft: fb_watterott: define backlight_ops statically |
| Date | 2015-08-16 22:40 +0200 |
| Message-ID | <pYcSK-2zI-31@gated-at.bofh.it> (permalink) |
| References | <pYcSJ-2zI-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
instead of devm_kzalloc'ing them
Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
---
drivers/staging/fbtft/fb_watterott.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c
index 88fb2c0..e8ebe2e 100644
--- a/drivers/staging/fbtft/fb_watterott.c
+++ b/drivers/staging/fbtft/fb_watterott.c
@@ -257,31 +257,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",
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] staging: fbtft: some checpatch.pl cleanups Mike Rapoport <mike.rapoport@gmail.com> - 2015-08-16 22:40 +0200 [PATCH 5/5] staging: fbtft: fb_watterott: define backlight_ops statically Mike Rapoport <mike.rapoport@gmail.com> - 2015-08-16 22:40 +0200 [PATCH 1/5] staging: fbtft: remove unused bl_ops from fbtft_unregister_backlight Mike Rapoport <mike.rapoport@gmail.com> - 2015-08-16 22:40 +0200 [PATCH 4/5] staging: fbtft: fb_ssd1351: define backlight_ops statically Mike Rapoport <mike.rapoport@gmail.com> - 2015-08-16 22:40 +0200 [PATCH 2/5] staging: fbtft: fbtft-core: define backlight_ops statically Mike Rapoport <mike.rapoport@gmail.com> - 2015-08-16 22:40 +0200
csiph-web