diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/corgi_bl.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index 4ca24e261578..c1eba0e8a1b0 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c | |||
@@ -61,17 +61,21 @@ static int corgibl_send_intensity(struct backlight_device *bd) | |||
61 | } | 61 | } |
62 | 62 | ||
63 | #ifdef CONFIG_PM | 63 | #ifdef CONFIG_PM |
64 | static int corgibl_suspend(struct platform_device *dev, pm_message_t state) | 64 | static int corgibl_suspend(struct platform_device *pdev, pm_message_t state) |
65 | { | 65 | { |
66 | struct backlight_device *bd = platform_get_drvdata(pdev); | ||
67 | |||
66 | corgibl_flags |= CORGIBL_SUSPENDED; | 68 | corgibl_flags |= CORGIBL_SUSPENDED; |
67 | corgibl_send_intensity(corgi_backlight_device); | 69 | corgibl_send_intensity(bd); |
68 | return 0; | 70 | return 0; |
69 | } | 71 | } |
70 | 72 | ||
71 | static int corgibl_resume(struct platform_device *dev) | 73 | static int corgibl_resume(struct platform_device *pdev) |
72 | { | 74 | { |
75 | struct backlight_device *bd = platform_get_drvdata(pdev); | ||
76 | |||
73 | corgibl_flags &= ~CORGIBL_SUSPENDED; | 77 | corgibl_flags &= ~CORGIBL_SUSPENDED; |
74 | corgibl_send_intensity(corgi_backlight_device); | 78 | corgibl_send_intensity(bd); |
75 | return 0; | 79 | return 0; |
76 | } | 80 | } |
77 | #else | 81 | #else |
@@ -84,12 +88,6 @@ static int corgibl_get_intensity(struct backlight_device *bd) | |||
84 | return corgibl_intensity; | 88 | return corgibl_intensity; |
85 | } | 89 | } |
86 | 90 | ||
87 | static int corgibl_set_intensity(struct backlight_device *bd) | ||
88 | { | ||
89 | corgibl_send_intensity(corgi_backlight_device); | ||
90 | return 0; | ||
91 | } | ||
92 | |||
93 | /* | 91 | /* |
94 | * Called when the battery is low to limit the backlight intensity. | 92 | * Called when the battery is low to limit the backlight intensity. |
95 | * If limit==0 clear any limit, otherwise limit the intensity | 93 | * If limit==0 clear any limit, otherwise limit the intensity |
@@ -107,7 +105,7 @@ EXPORT_SYMBOL(corgibl_limit_intensity); | |||
107 | 105 | ||
108 | static struct backlight_properties corgibl_data = { | 106 | static struct backlight_properties corgibl_data = { |
109 | .get_brightness = corgibl_get_intensity, | 107 | .get_brightness = corgibl_get_intensity, |
110 | .update_status = corgibl_set_intensity, | 108 | .update_status = corgibl_send_intensity, |
111 | }; | 109 | }; |
112 | 110 | ||
113 | static int corgibl_probe(struct platform_device *pdev) | 111 | static int corgibl_probe(struct platform_device *pdev) |
@@ -124,6 +122,8 @@ static int corgibl_probe(struct platform_device *pdev) | |||
124 | if (IS_ERR (corgi_backlight_device)) | 122 | if (IS_ERR (corgi_backlight_device)) |
125 | return PTR_ERR (corgi_backlight_device); | 123 | return PTR_ERR (corgi_backlight_device); |
126 | 124 | ||
125 | platform_set_drvdata(pdev, corgi_backlight_device); | ||
126 | |||
127 | corgibl_data.power = FB_BLANK_UNBLANK; | 127 | corgibl_data.power = FB_BLANK_UNBLANK; |
128 | corgibl_data.brightness = machinfo->default_intensity; | 128 | corgibl_data.brightness = machinfo->default_intensity; |
129 | corgibl_send_intensity(corgi_backlight_device); | 129 | corgibl_send_intensity(corgi_backlight_device); |
@@ -132,13 +132,15 @@ static int corgibl_probe(struct platform_device *pdev) | |||
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | static int corgibl_remove(struct platform_device *dev) | 135 | static int corgibl_remove(struct platform_device *pdev) |
136 | { | 136 | { |
137 | struct backlight_device *bd = platform_get_drvdata(pdev); | ||
138 | |||
137 | corgibl_data.power = 0; | 139 | corgibl_data.power = 0; |
138 | corgibl_data.brightness = 0; | 140 | corgibl_data.brightness = 0; |
139 | corgibl_send_intensity(corgi_backlight_device); | 141 | corgibl_send_intensity(bd); |
140 | 142 | ||
141 | backlight_device_unregister(corgi_backlight_device); | 143 | backlight_device_unregister(bd); |
142 | 144 | ||
143 | printk("Corgi Backlight Driver Unloaded\n"); | 145 | printk("Corgi Backlight Driver Unloaded\n"); |
144 | return 0; | 146 | return 0; |