diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-02-10 18:07:48 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-20 04:26:53 -0500 |
commit | 599a52d12629394236d785615808845823875868 (patch) | |
tree | 4e2dfa3a25ce761be0ecc0490acabac553f77a67 /drivers/video/backlight/hp680_bl.c | |
parent | 321709c5994f952b78d567fd7083dbebbdc381b7 (diff) |
backlight: Separate backlight properties from backlight ops pointers
Per device data such as brightness belongs to the indivdual device
and should therefore be separate from the the backlight operation
function pointers. This patch splits the two types of data and
allows simplifcation of some code.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video/backlight/hp680_bl.c')
-rw-r--r-- | drivers/video/backlight/hp680_bl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c index e7444c8f289d..0899fccbd570 100644 --- a/drivers/video/backlight/hp680_bl.c +++ b/drivers/video/backlight/hp680_bl.c | |||
@@ -33,11 +33,11 @@ static void hp680bl_send_intensity(struct backlight_device *bd) | |||
33 | { | 33 | { |
34 | unsigned long flags; | 34 | unsigned long flags; |
35 | u16 v; | 35 | u16 v; |
36 | int intensity = bd->props->brightness; | 36 | int intensity = bd->props.brightness; |
37 | 37 | ||
38 | if (bd->props->power != FB_BLANK_UNBLANK) | 38 | if (bd->props.power != FB_BLANK_UNBLANK) |
39 | intensity = 0; | 39 | intensity = 0; |
40 | if (bd->props->fb_blank != FB_BLANK_UNBLANK) | 40 | if (bd->props.fb_blank != FB_BLANK_UNBLANK) |
41 | intensity = 0; | 41 | intensity = 0; |
42 | if (hp680bl_suspended) | 42 | if (hp680bl_suspended) |
43 | intensity = 0; | 43 | intensity = 0; |
@@ -98,8 +98,7 @@ static int hp680bl_get_intensity(struct backlight_device *bd) | |||
98 | return current_intensity; | 98 | return current_intensity; |
99 | } | 99 | } |
100 | 100 | ||
101 | static struct backlight_properties hp680bl_data = { | 101 | static struct backlight_ops hp680bl_ops = { |
102 | .max_brightness = HP680_MAX_INTENSITY, | ||
103 | .get_brightness = hp680bl_get_intensity, | 102 | .get_brightness = hp680bl_get_intensity, |
104 | .update_status = hp680bl_set_intensity, | 103 | .update_status = hp680bl_set_intensity, |
105 | }; | 104 | }; |
@@ -109,13 +108,14 @@ static int __init hp680bl_probe(struct platform_device *pdev) | |||
109 | struct backlight_device *bd; | 108 | struct backlight_device *bd; |
110 | 109 | ||
111 | bd = backlight_device_register ("hp680-bl", &pdev->dev, NULL, | 110 | bd = backlight_device_register ("hp680-bl", &pdev->dev, NULL, |
112 | &hp680bl_data); | 111 | &hp680bl_ops); |
113 | if (IS_ERR(bd)) | 112 | if (IS_ERR(bd)) |
114 | return PTR_ERR(bd); | 113 | return PTR_ERR(bd); |
115 | 114 | ||
116 | platform_set_drvdata(pdev, bd); | 115 | platform_set_drvdata(pdev, bd); |
117 | 116 | ||
118 | bd->props->brightness = HP680_DEFAULT_INTENSITY; | 117 | bd->props.max_brightness = HP680_MAX_INTENSITY; |
118 | bd->props.brightness = HP680_DEFAULT_INTENSITY; | ||
119 | hp680bl_send_intensity(bd); | 119 | hp680bl_send_intensity(bd); |
120 | 120 | ||
121 | return 0; | 121 | return 0; |