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

video: ARM CLCD: use panel device node for panel initialization

There is no necessity to pass an endpoint device node to custom panel
initialization functions, because a child panel device node should be
sufficient, note that the existing init_panel() callback declaration from
linux/amba/clcd.h already prompts to use the panel device node here.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Vladimir Zapolskiy and committed by
Bartlomiej Zolnierkiewicz
be736796 69550ad2

+14 -27
+1 -8
drivers/video/fbdev/amba-clcd-nomadik.c
··· 214 214 board->disable = tpg110_disable; 215 215 } 216 216 217 - int nomadik_clcd_init_panel(struct clcd_fb *fb, 218 - struct device_node *endpoint) 217 + int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel) 219 218 { 220 - struct device_node *panel; 221 - 222 - panel = of_graph_get_remote_port_parent(endpoint); 223 - if (!panel) 224 - return -ENODEV; 225 - 226 219 if (of_device_is_compatible(panel, "tpo,tpg110")) 227 220 tpg110_init(&fb->dev->dev, panel, fb->board); 228 221 else
+2 -3
drivers/video/fbdev/amba-clcd-nomadik.h
··· 6 6 #ifdef CONFIG_ARCH_NOMADIK 7 7 int nomadik_clcd_init_board(struct amba_device *adev, 8 8 struct clcd_board *board); 9 - int nomadik_clcd_init_panel(struct clcd_fb *fb, 10 - struct device_node *endpoint); 9 + int nomadik_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel); 11 10 #else 12 11 static inline int nomadik_clcd_init_board(struct amba_device *adev, 13 12 struct clcd_board *board) ··· 14 15 return 0; 15 16 } 16 17 static inline int nomadik_clcd_init_panel(struct clcd_fb *fb, 17 - struct device_node *endpoint) 18 + struct device_node *panel) 18 19 { 19 20 return 0; 20 21 }
+3 -11
drivers/video/fbdev/amba-clcd-versatile.c
··· 452 452 }, 453 453 }; 454 454 455 - static void versatile_panel_probe(struct device *dev, 456 - struct device_node *endpoint) 455 + static void versatile_panel_probe(struct device *dev, struct device_node *panel) 457 456 { 458 457 struct versatile_panel const *vpanel = NULL; 459 - struct device_node *panel = NULL; 460 458 u32 val; 461 459 int ret; 462 460 int i; ··· 486 488 return; 487 489 } 488 490 489 - panel = of_graph_get_remote_port_parent(endpoint); 490 - if (!panel) { 491 - dev_err(dev, "could not locate panel in DT\n"); 492 - return; 493 - } 494 491 if (!of_device_is_compatible(panel, vpanel->compatible)) 495 492 dev_err(dev, "panel in DT is not compatible with the " 496 493 "auto-detected panel, continuing anyway\n"); ··· 507 514 } 508 515 } 509 516 510 - int versatile_clcd_init_panel(struct clcd_fb *fb, 511 - struct device_node *endpoint) 517 + int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel) 512 518 { 513 519 const struct of_device_id *clcd_id; 514 520 enum versatile_clcd versatile_clcd_type; ··· 543 551 fb->board->enable = versatile_clcd_enable; 544 552 fb->board->disable = versatile_clcd_disable; 545 553 fb->board->decode = versatile_clcd_decode; 546 - versatile_panel_probe(dev, endpoint); 554 + versatile_panel_probe(dev, panel); 547 555 dev_info(dev, "set up callbacks for Versatile\n"); 548 556 break; 549 557 case REALVIEW_CLCD_EB:
+2 -3
drivers/video/fbdev/amba-clcd-versatile.h
··· 6 6 #include <linux/platform_data/video-clcd-versatile.h> 7 7 8 8 #if defined(CONFIG_PLAT_VERSATILE_CLCD) && defined(CONFIG_OF) 9 - int versatile_clcd_init_panel(struct clcd_fb *fb, 10 - struct device_node *endpoint); 9 + int versatile_clcd_init_panel(struct clcd_fb *fb, struct device_node *panel); 11 10 #else 12 11 static inline int versatile_clcd_init_panel(struct clcd_fb *fb, 13 - struct device_node *endpoint) 12 + struct device_node *panel) 14 13 { 15 14 return 0; 16 15 }
+6 -2
drivers/video/fbdev/amba-clcd.c
··· 764 764 765 765 static int clcdfb_of_init_display(struct clcd_fb *fb) 766 766 { 767 - struct device_node *endpoint; 767 + struct device_node *endpoint, *panel; 768 768 int err; 769 769 unsigned int bpp; 770 770 u32 max_bandwidth; ··· 781 781 if (!endpoint) 782 782 return -ENODEV; 783 783 784 + panel = of_graph_get_remote_port_parent(endpoint); 785 + if (!panel) 786 + return -ENODEV; 787 + 784 788 if (fb->vendor->init_panel) { 785 - err = fb->vendor->init_panel(fb, endpoint); 789 + err = fb->vendor->init_panel(fb, panel); 786 790 if (err) 787 791 return err; 788 792 }