@@ -288,6 +288,13 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)
288
288
init_backlight (sinfo );
289
289
}
290
290
291
+ static inline void atmel_lcdfb_power_control (struct atmel_lcdfb_info * sinfo , int on )
292
+ {
293
+ struct atmel_lcdfb_pdata * pdata = & sinfo -> pdata ;
294
+
295
+ if (pdata -> atmel_lcdfb_power_control )
296
+ pdata -> atmel_lcdfb_power_control (on );
297
+ }
291
298
292
299
static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
293
300
.type = FB_TYPE_PACKED_PIXELS ,
@@ -1122,8 +1129,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
1122
1129
fb_add_videomode (& fbmode , & info -> modelist );
1123
1130
1124
1131
/* Power up the LCDC screen */
1125
- if (pdata -> atmel_lcdfb_power_control )
1126
- pdata -> atmel_lcdfb_power_control (1 );
1132
+ atmel_lcdfb_power_control (sinfo , 1 );
1127
1133
1128
1134
dev_info (dev , "fb%d: Atmel LCDC at 0x%08lx (mapped at %p), irq %d\n" ,
1129
1135
info -> node , info -> fix .mmio_start , sinfo -> mmio , sinfo -> irq_base );
@@ -1175,8 +1181,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
1175
1181
1176
1182
cancel_work_sync (& sinfo -> task );
1177
1183
exit_backlight (sinfo );
1178
- if (pdata -> atmel_lcdfb_power_control )
1179
- pdata -> atmel_lcdfb_power_control (0 );
1184
+ atmel_lcdfb_power_control (sinfo , 0 );
1180
1185
unregister_framebuffer (info );
1181
1186
atmel_lcdfb_stop_clock (sinfo );
1182
1187
clk_put (sinfo -> lcdc_clk );
@@ -1203,7 +1208,6 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
1203
1208
{
1204
1209
struct fb_info * info = platform_get_drvdata (pdev );
1205
1210
struct atmel_lcdfb_info * sinfo = info -> par ;
1206
- struct atmel_lcdfb_pdata * pdata = & sinfo -> pdata ;
1207
1211
1208
1212
/*
1209
1213
* We don't want to handle interrupts while the clock is
@@ -1213,9 +1217,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
1213
1217
1214
1218
sinfo -> saved_lcdcon = lcdc_readl (sinfo , ATMEL_LCDC_CONTRAST_CTR );
1215
1219
lcdc_writel (sinfo , ATMEL_LCDC_CONTRAST_CTR , 0 );
1216
- if (pdata -> atmel_lcdfb_power_control )
1217
- pdata -> atmel_lcdfb_power_control (0 );
1218
-
1220
+ atmel_lcdfb_power_control (sinfo , 0 );
1219
1221
atmel_lcdfb_stop (sinfo );
1220
1222
atmel_lcdfb_stop_clock (sinfo );
1221
1223
@@ -1226,12 +1228,10 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
1226
1228
{
1227
1229
struct fb_info * info = platform_get_drvdata (pdev );
1228
1230
struct atmel_lcdfb_info * sinfo = info -> par ;
1229
- struct atmel_lcdfb_pdata * pdata = & sinfo -> pdata ;
1230
1231
1231
1232
atmel_lcdfb_start_clock (sinfo );
1232
1233
atmel_lcdfb_start (sinfo );
1233
- if (pdata -> atmel_lcdfb_power_control )
1234
- pdata -> atmel_lcdfb_power_control (1 );
1234
+ atmel_lcdfb_power_control (sinfo , 1 );
1235
1235
lcdc_writel (sinfo , ATMEL_LCDC_CONTRAST_CTR , sinfo -> saved_lcdcon );
1236
1236
1237
1237
/* Enable FIFO & DMA errors */
0 commit comments