diff options
| -rw-r--r-- | drivers/video/fbsysfs.c | 53 |
1 files changed, 20 insertions, 33 deletions
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 0a1dc1b4b509..35147030a3e8 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c | |||
| @@ -106,8 +106,7 @@ static int mode_string(char *buf, unsigned int offset, | |||
| 106 | static ssize_t store_mode(struct class_device *class_device, const char * buf, | 106 | static ssize_t store_mode(struct class_device *class_device, const char * buf, |
| 107 | size_t count) | 107 | size_t count) |
| 108 | { | 108 | { |
| 109 | struct fb_info *fb_info = | 109 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 110 | (struct fb_info *)class_get_devdata(class_device); | ||
| 111 | char mstr[100]; | 110 | char mstr[100]; |
| 112 | struct fb_var_screeninfo var; | 111 | struct fb_var_screeninfo var; |
| 113 | struct fb_modelist *modelist; | 112 | struct fb_modelist *modelist; |
| @@ -137,8 +136,7 @@ static ssize_t store_mode(struct class_device *class_device, const char * buf, | |||
| 137 | 136 | ||
| 138 | static ssize_t show_mode(struct class_device *class_device, char *buf) | 137 | static ssize_t show_mode(struct class_device *class_device, char *buf) |
| 139 | { | 138 | { |
| 140 | struct fb_info *fb_info = | 139 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 141 | (struct fb_info *)class_get_devdata(class_device); | ||
| 142 | 140 | ||
| 143 | if (!fb_info->mode) | 141 | if (!fb_info->mode) |
| 144 | return 0; | 142 | return 0; |
| @@ -149,8 +147,7 @@ static ssize_t show_mode(struct class_device *class_device, char *buf) | |||
| 149 | static ssize_t store_modes(struct class_device *class_device, const char * buf, | 147 | static ssize_t store_modes(struct class_device *class_device, const char * buf, |
| 150 | size_t count) | 148 | size_t count) |
| 151 | { | 149 | { |
| 152 | struct fb_info *fb_info = | 150 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 153 | (struct fb_info *)class_get_devdata(class_device); | ||
| 154 | LIST_HEAD(old_list); | 151 | LIST_HEAD(old_list); |
| 155 | int i = count / sizeof(struct fb_videomode); | 152 | int i = count / sizeof(struct fb_videomode); |
| 156 | 153 | ||
| @@ -174,8 +171,7 @@ static ssize_t store_modes(struct class_device *class_device, const char * buf, | |||
| 174 | 171 | ||
| 175 | static ssize_t show_modes(struct class_device *class_device, char *buf) | 172 | static ssize_t show_modes(struct class_device *class_device, char *buf) |
| 176 | { | 173 | { |
| 177 | struct fb_info *fb_info = | 174 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 178 | (struct fb_info *)class_get_devdata(class_device); | ||
| 179 | unsigned int i; | 175 | unsigned int i; |
| 180 | struct list_head *pos; | 176 | struct list_head *pos; |
| 181 | struct fb_modelist *modelist; | 177 | struct fb_modelist *modelist; |
| @@ -193,8 +189,7 @@ static ssize_t show_modes(struct class_device *class_device, char *buf) | |||
| 193 | static ssize_t store_bpp(struct class_device *class_device, const char * buf, | 189 | static ssize_t store_bpp(struct class_device *class_device, const char * buf, |
| 194 | size_t count) | 190 | size_t count) |
| 195 | { | 191 | { |
| 196 | struct fb_info *fb_info = | 192 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 197 | (struct fb_info *)class_get_devdata(class_device); | ||
| 198 | struct fb_var_screeninfo var; | 193 | struct fb_var_screeninfo var; |
| 199 | char ** last = NULL; | 194 | char ** last = NULL; |
| 200 | int err; | 195 | int err; |
| @@ -208,8 +203,7 @@ static ssize_t store_bpp(struct class_device *class_device, const char * buf, | |||
| 208 | 203 | ||
| 209 | static ssize_t show_bpp(struct class_device *class_device, char *buf) | 204 | static ssize_t show_bpp(struct class_device *class_device, char *buf) |
| 210 | { | 205 | { |
| 211 | struct fb_info *fb_info = | 206 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 212 | (struct fb_info *)class_get_devdata(class_device); | ||
| 213 | return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.bits_per_pixel); | 207 | return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.bits_per_pixel); |
| 214 | } | 208 | } |
| 215 | 209 | ||
| @@ -280,8 +274,7 @@ static ssize_t show_con_rotate(struct class_device *class_device, char *buf) | |||
| 280 | static ssize_t store_virtual(struct class_device *class_device, | 274 | static ssize_t store_virtual(struct class_device *class_device, |
| 281 | const char * buf, size_t count) | 275 | const char * buf, size_t count) |
| 282 | { | 276 | { |
| 283 | struct fb_info *fb_info = | 277 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 284 | (struct fb_info *)class_get_devdata(class_device); | ||
| 285 | struct fb_var_screeninfo var; | 278 | struct fb_var_screeninfo var; |
| 286 | char *last = NULL; | 279 | char *last = NULL; |
| 287 | int err; | 280 | int err; |
| @@ -300,16 +293,14 @@ static ssize_t store_virtual(struct class_device *class_device, | |||
| 300 | 293 | ||
| 301 | static ssize_t show_virtual(struct class_device *class_device, char *buf) | 294 | static ssize_t show_virtual(struct class_device *class_device, char *buf) |
| 302 | { | 295 | { |
| 303 | struct fb_info *fb_info = | 296 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 304 | (struct fb_info *)class_get_devdata(class_device); | ||
| 305 | return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual, | 297 | return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual, |
| 306 | fb_info->var.yres_virtual); | 298 | fb_info->var.yres_virtual); |
| 307 | } | 299 | } |
| 308 | 300 | ||
| 309 | static ssize_t show_stride(struct class_device *class_device, char *buf) | 301 | static ssize_t show_stride(struct class_device *class_device, char *buf) |
| 310 | { | 302 | { |
| 311 | struct fb_info *fb_info = | 303 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 312 | (struct fb_info *)class_get_devdata(class_device); | ||
| 313 | return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length); | 304 | return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length); |
| 314 | } | 305 | } |
| 315 | 306 | ||
| @@ -320,7 +311,7 @@ static ssize_t show_stride(struct class_device *class_device, char *buf) | |||
| 320 | static ssize_t store_cmap(struct class_device *class_device, const char *buf, | 311 | static ssize_t store_cmap(struct class_device *class_device, const char *buf, |
| 321 | size_t count) | 312 | size_t count) |
| 322 | { | 313 | { |
| 323 | struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | 314 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 324 | int rc, i, start, length, transp = 0; | 315 | int rc, i, start, length, transp = 0; |
| 325 | 316 | ||
| 326 | if ((count > PAGE_SIZE) || ((count % 16) != 0)) | 317 | if ((count > PAGE_SIZE) || ((count % 16) != 0)) |
| @@ -380,8 +371,7 @@ static ssize_t store_cmap(struct class_device *class_device, const char *buf, | |||
| 380 | 371 | ||
| 381 | static ssize_t show_cmap(struct class_device *class_device, char *buf) | 372 | static ssize_t show_cmap(struct class_device *class_device, char *buf) |
| 382 | { | 373 | { |
| 383 | struct fb_info *fb_info = | 374 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 384 | (struct fb_info *)class_get_devdata(class_device); | ||
| 385 | unsigned int i; | 375 | unsigned int i; |
| 386 | 376 | ||
| 387 | if (!fb_info->cmap.red || !fb_info->cmap.blue || | 377 | if (!fb_info->cmap.red || !fb_info->cmap.blue || |
| @@ -405,8 +395,7 @@ static ssize_t show_cmap(struct class_device *class_device, char *buf) | |||
| 405 | static ssize_t store_blank(struct class_device *class_device, const char * buf, | 395 | static ssize_t store_blank(struct class_device *class_device, const char * buf, |
| 406 | size_t count) | 396 | size_t count) |
| 407 | { | 397 | { |
| 408 | struct fb_info *fb_info = | 398 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 409 | (struct fb_info *)class_get_devdata(class_device); | ||
| 410 | char *last = NULL; | 399 | char *last = NULL; |
| 411 | int err; | 400 | int err; |
| 412 | 401 | ||
| @@ -422,41 +411,40 @@ static ssize_t store_blank(struct class_device *class_device, const char * buf, | |||
| 422 | 411 | ||
| 423 | static ssize_t show_blank(struct class_device *class_device, char *buf) | 412 | static ssize_t show_blank(struct class_device *class_device, char *buf) |
| 424 | { | 413 | { |
| 425 | // struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | 414 | // struct fb_info *fb_info = class_get_devdata(class_device); |
| 426 | return 0; | 415 | return 0; |
| 427 | } | 416 | } |
| 428 | 417 | ||
| 429 | static ssize_t store_console(struct class_device *class_device, | 418 | static ssize_t store_console(struct class_device *class_device, |
| 430 | const char * buf, size_t count) | 419 | const char * buf, size_t count) |
| 431 | { | 420 | { |
| 432 | // struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | 421 | // struct fb_info *fb_info = class_get_devdata(class_device); |
| 433 | return 0; | 422 | return 0; |
| 434 | } | 423 | } |
| 435 | 424 | ||
| 436 | static ssize_t show_console(struct class_device *class_device, char *buf) | 425 | static ssize_t show_console(struct class_device *class_device, char *buf) |
| 437 | { | 426 | { |
| 438 | // struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | 427 | // struct fb_info *fb_info = class_get_devdata(class_device); |
| 439 | return 0; | 428 | return 0; |
| 440 | } | 429 | } |
| 441 | 430 | ||
| 442 | static ssize_t store_cursor(struct class_device *class_device, | 431 | static ssize_t store_cursor(struct class_device *class_device, |
| 443 | const char * buf, size_t count) | 432 | const char * buf, size_t count) |
| 444 | { | 433 | { |
| 445 | // struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | 434 | // struct fb_info *fb_info = class_get_devdata(class_device); |
| 446 | return 0; | 435 | return 0; |
| 447 | } | 436 | } |
| 448 | 437 | ||
| 449 | static ssize_t show_cursor(struct class_device *class_device, char *buf) | 438 | static ssize_t show_cursor(struct class_device *class_device, char *buf) |
| 450 | { | 439 | { |
| 451 | // struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | 440 | // struct fb_info *fb_info = class_get_devdata(class_device); |
| 452 | return 0; | 441 | return 0; |
| 453 | } | 442 | } |
| 454 | 443 | ||
| 455 | static ssize_t store_pan(struct class_device *class_device, const char * buf, | 444 | static ssize_t store_pan(struct class_device *class_device, const char * buf, |
| 456 | size_t count) | 445 | size_t count) |
| 457 | { | 446 | { |
| 458 | struct fb_info *fb_info = | 447 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 459 | (struct fb_info *)class_get_devdata(class_device); | ||
| 460 | struct fb_var_screeninfo var; | 448 | struct fb_var_screeninfo var; |
| 461 | char *last = NULL; | 449 | char *last = NULL; |
| 462 | int err; | 450 | int err; |
| @@ -479,15 +467,14 @@ static ssize_t store_pan(struct class_device *class_device, const char * buf, | |||
| 479 | 467 | ||
| 480 | static ssize_t show_pan(struct class_device *class_device, char *buf) | 468 | static ssize_t show_pan(struct class_device *class_device, char *buf) |
| 481 | { | 469 | { |
| 482 | struct fb_info *fb_info = | 470 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 483 | (struct fb_info *)class_get_devdata(class_device); | ||
| 484 | return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xoffset, | 471 | return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xoffset, |
| 485 | fb_info->var.xoffset); | 472 | fb_info->var.xoffset); |
| 486 | } | 473 | } |
| 487 | 474 | ||
| 488 | static ssize_t show_name(struct class_device *class_device, char *buf) | 475 | static ssize_t show_name(struct class_device *class_device, char *buf) |
| 489 | { | 476 | { |
| 490 | struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | 477 | struct fb_info *fb_info = class_get_devdata(class_device); |
| 491 | 478 | ||
| 492 | return snprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id); | 479 | return snprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id); |
| 493 | } | 480 | } |
