Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify

It's dead code, and removing it avoids me having to understand
what it's doing with lock_fb_info.

v2: Also remove sh_mobile_lcdc_must_reconfigure, now unused (Sam).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> (v1)
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190528090304.9388-12-daniel.vetter@ffwll.ch

-87
-82
drivers/video/fbdev/sh_mobile_lcdcfb.c
··· 534 534 ch->tx_dev->ops->display_off(ch->tx_dev); 535 535 } 536 536 537 - static bool 538 - sh_mobile_lcdc_must_reconfigure(struct sh_mobile_lcdc_chan *ch, 539 - const struct fb_videomode *new_mode) 540 - { 541 - dev_dbg(ch->info->dev, "Old %ux%u, new %ux%u\n", 542 - ch->display.mode.xres, ch->display.mode.yres, 543 - new_mode->xres, new_mode->yres); 544 - 545 - /* It can be a different monitor with an equal video-mode */ 546 - if (fb_mode_is_equal(&ch->display.mode, new_mode)) 547 - return false; 548 - 549 - dev_dbg(ch->info->dev, "Switching %u -> %u lines\n", 550 - ch->display.mode.yres, new_mode->yres); 551 - ch->display.mode = *new_mode; 552 - 553 - return true; 554 - } 555 - 556 537 static int sh_mobile_lcdc_check_var(struct fb_var_screeninfo *var, 557 538 struct fb_info *info); 558 - 559 - static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch, 560 - enum sh_mobile_lcdc_entity_event event, 561 - const struct fb_videomode *mode, 562 - const struct fb_monspecs *monspec) 563 - { 564 - struct fb_info *info = ch->info; 565 - struct fb_var_screeninfo var; 566 - int ret = 0; 567 - 568 - switch (event) { 569 - case SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT: 570 - /* HDMI plug in */ 571 - console_lock(); 572 - if (lock_fb_info(info)) { 573 - 574 - 575 - ch->display.width = monspec->max_x * 10; 576 - ch->display.height = monspec->max_y * 10; 577 - 578 - if (!sh_mobile_lcdc_must_reconfigure(ch, mode) && 579 - info->state == FBINFO_STATE_RUNNING) { 580 - /* First activation with the default monitor. 581 - * Just turn on, if we run a resume here, the 582 - * logo disappears. 583 - */ 584 - info->var.width = ch->display.width; 585 - info->var.height = ch->display.height; 586 - sh_mobile_lcdc_display_on(ch); 587 - } else { 588 - /* New monitor or have to wake up */ 589 - fb_set_suspend(info, 0); 590 - } 591 - 592 - 593 - unlock_fb_info(info); 594 - } 595 - console_unlock(); 596 - break; 597 - 598 - case SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT: 599 - /* HDMI disconnect */ 600 - console_lock(); 601 - if (lock_fb_info(info)) { 602 - fb_set_suspend(info, 1); 603 - unlock_fb_info(info); 604 - } 605 - console_unlock(); 606 - break; 607 - 608 - case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE: 609 - /* Validate a proposed new mode */ 610 - fb_videomode_to_var(&var, mode); 611 - var.bits_per_pixel = info->var.bits_per_pixel; 612 - var.grayscale = info->var.grayscale; 613 - ret = sh_mobile_lcdc_check_var(&var, info); 614 - break; 615 - } 616 - 617 - return ret; 618 - } 619 539 620 540 /* ----------------------------------------------------------------------------- 621 541 * Format helpers ··· 2459 2539 unsigned int num_modes; 2460 2540 unsigned int max_size; 2461 2541 unsigned int i; 2462 - 2463 - ch->notify = sh_mobile_lcdc_display_notify; 2464 2542 2465 2543 /* Validate the format. */ 2466 2544 format = sh_mobile_format_info(cfg->fourcc);
-5
drivers/video/fbdev/sh_mobile_lcdcfb.h
··· 87 87 unsigned long base_addr_c; 88 88 unsigned int line_size; 89 89 90 - int (*notify)(struct sh_mobile_lcdc_chan *ch, 91 - enum sh_mobile_lcdc_entity_event event, 92 - const struct fb_videomode *mode, 93 - const struct fb_monspecs *monspec); 94 - 95 90 /* Backlight */ 96 91 struct backlight_device *bl; 97 92 unsigned int bl_brightness;