Messages in this thread | | | Date | Fri, 03 Feb 2012 23:25:12 +0100 | From | Lars-Peter Clausen <> | Subject | Re: [PATCH 2/3] apple_bl: Rework in advance of gmux backlight support |
| |
On 02/03/2012 09:28 PM, Seth Forshee wrote: > Make it easier to support backlights without a fixed I/O range, and > remove use of global variables to allow having multiple backlights > concurrently. > > Signed-off-by: Seth Forshee <seth.forshee@canonical.com> > --- > drivers/video/backlight/apple_bl.c | 163 +++++++++++++++++++----------------- > 1 files changed, 85 insertions(+), 78 deletions(-) > > diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c > index 66d5bec..e65b459 100644 > --- a/drivers/video/backlight/apple_bl.c > +++ b/drivers/video/backlight/apple_bl.c > @@ -27,39 +27,30 @@ > #include <linux/pci.h> > #include <linux/acpi.h> > [...] > + */ > +static int apple_bl_get_brightness(struct backlight_device *bd) > +{ > + struct apple_bl_data *bl_data = bl_get_data(bd); > + return bl_data->get_brightness(bl_data); > +} > + > +static int apple_bl_update_status(struct backlight_device *bd) > +{ > + struct apple_bl_data *bl_data = bl_get_data(bd); > + > + bl_data->set_brightness(bl_data, bd->props.brightness); > + return 0; > +} > + > +static const struct backlight_ops apple_bl_ops = { > + .get_brightness = apple_bl_get_brightness, > + .update_status = apple_bl_update_status, > };
Adding this extra indirection here isn't so nice and isn't necessary either. Just define one set of backlight ops for the intel case and one for the nvidia case and use it accordingly when registering the backlight device.
| |