History

video: fbdev: imxfb: Drop platform data support

No source file but the driver itself includes the header containing the platform data definition. The last user is gone since commit 8485adf17a15 ("ARM: imx: Remove imx device directory"). So we can safely drop platform data support.

Uwe Kleine-König committed 4 years ago

Commit e948d321 parent 26c2b7d2 files · +34 −77Browse files

Unified · Split

2 files
  1. drivers/video/fbdev/imxfb.c +34 −65
  2. include/linux/platform_data/video-imxfb.h +0 −12
drivers/video/fbdev/imxfb.c+34−65
@@ -656,7 +656,6 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf · 655 unmodified lines
656656
657657 static int imxfb_init_fbinfo(struct platform_device *pdev)
658658 {
659− struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev);
660659 struct fb_info *info = platform_get_drvdata(pdev);
661660 struct imxfb_info *fbi = info->par;
662661 struct device_node *np;
@@ -690,25 +689,20 @@ static int imxfb_init_fbinfo(struct platform_device *pdev) · 27 unmodified lines
690689 info->fbops = &imxfb_ops;
691690 info->flags = FBINFO_FLAG_DEFAULT |
692691 FBINFO_READS_FAST;
693− if (pdata) {
694− fbi->lscr1 = pdata->lscr1;
695− fbi->dmacr = pdata->dmacr;
696− fbi->pwmr = pdata->pwmr;
697− } else {
698− np = pdev->dev.of_node;
699− info->var.grayscale = of_property_read_bool(np,
700− "cmap-greyscale");
701− fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse");
702− fbi->cmap_static = of_property_read_bool(np, "cmap-static");
703692
704− fbi->lscr1 = IMXFB_LSCR1_DEFAULT;
693+ np = pdev->dev.of_node;
694+ info->var.grayscale = of_property_read_bool(np,
695+ "cmap-greyscale");
696+ fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse");
697+ fbi->cmap_static = of_property_read_bool(np, "cmap-static");
705698
706− of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr);
699+ fbi->lscr1 = IMXFB_LSCR1_DEFAULT;
707700
708− of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1);
701+ of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr);
709702
710− of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr);
711− }
703+ of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1);
704+
705+ of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr);
712706
713707 return 0;
714708 }
@@ -863,10 +857,10 @@ static int imxfb_probe(struct platform_device *pdev) · 148 unmodified lines
863857 struct imxfb_info *fbi;
864858 struct lcd_device *lcd;
865859 struct fb_info *info;
866− struct imx_fb_platform_data *pdata;
867860 struct resource *res;
868861 struct imx_fb_videomode *m;
869862 const struct of_device_id *of_id;
863+ struct device_node *display_np;
870864 int ret, i;
871865 int bytes_per_pixel;
872866
@@ -884,8 +878,6 @@ static int imxfb_probe(struct platform_device *pdev) · 11 unmodified lines
884878 if (!res)
885879 return -ENODEV;
886880
887− pdata = dev_get_platdata(&pdev->dev);
888−
889881 info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
890882 if (!info)
891883 return -ENOMEM;
@@ -898,43 +890,34 @@ static int imxfb_probe(struct platform_device *pdev) · 6 unmodified lines
898890 if (ret < 0)
899891 goto failed_init;
900892
901− if (pdata) {
902− if (!fb_mode)
903− fb_mode = pdata->mode[0].mode.name;
904−
905− fbi->mode = pdata->mode;
906− fbi->num_modes = pdata->num_modes;
907− } else {
908− struct device_node *display_np;
909− fb_mode = NULL;
910−
911− display_np = of_parse_phandle(pdev->dev.of_node, "display", 0);
912− if (!display_np) {
913− dev_err(&pdev->dev, "No display defined in devicetree\n");
914− ret = -EINVAL;
915− goto failed_of_parse;
916− }
893+ fb_mode = NULL;
917894
918− /*
919− * imxfb does not support more modes, we choose only the native
920− * mode.
921− */
922− fbi->num_modes = 1;
923−
924− fbi->mode = devm_kzalloc(&pdev->dev,
925− sizeof(struct imx_fb_videomode), GFP_KERNEL);
926− if (!fbi->mode) {
927− ret = -ENOMEM;
928− of_node_put(display_np);
929− goto failed_of_parse;
930− }
895+ display_np = of_parse_phandle(pdev->dev.of_node, "display", 0);
896+ if (!display_np) {
897+ dev_err(&pdev->dev, "No display defined in devicetree\n");
898+ ret = -EINVAL;
899+ goto failed_of_parse;
900+ }
931901
932− ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
902+ /*
903+ * imxfb does not support more modes, we choose only the native
904+ * mode.
905+ */
906+ fbi->num_modes = 1;
907+
908+ fbi->mode = devm_kzalloc(&pdev->dev,
909+ sizeof(struct imx_fb_videomode), GFP_KERNEL);
910+ if (!fbi->mode) {
911+ ret = -ENOMEM;
933912 of_node_put(display_np);
934− if (ret)
935− goto failed_of_parse;
913+ goto failed_of_parse;
936914 }
937915
916+ ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
917+ of_node_put(display_np);
918+ if (ret)
919+ goto failed_of_parse;
920+
938921 /* Calculate maximum bytes used per pixel. In most cases this should
939922 * be the same as m->bpp/8 */
940923 m = &fbi->mode[0];
@@ -1001,13 +984,6 @@ static int imxfb_probe(struct platform_device *pdev) · 60 unmodified lines
1001984
1002985 info->fix.smem_start = fbi->map_dma;
1003986
1004− if (pdata && pdata->init) {
1005− ret = pdata->init(fbi->pdev);
1006− if (ret)
1007− goto failed_platform_init;
1008− }
1009−
1010−
1011987 INIT_LIST_HEAD(&info->modelist);
1012988 for (i = 0; i < fbi->num_modes; i++)
1013989 fb_add_videomode(&fbi->mode[i].mode, &info->modelist);
@@ -1059,9 +1035,6 @@ failed_lcd: · 45 unmodified lines
10591035 failed_register:
10601036 fb_dealloc_cmap(&info->cmap);
10611037 failed_cmap:
1062− if (pdata && pdata->exit)
1063− pdata->exit(fbi->pdev);
1064−failed_platform_init:
10651038 dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
10661039 fbi->map_dma);
10671040 failed_map:
@@ -1079,7 +1052,6 @@ failed_init: · 11 unmodified lines
10791052
10801053 static int imxfb_remove(struct platform_device *pdev)
10811054 {
1082− struct imx_fb_platform_data *pdata;
10831055 struct fb_info *info = platform_get_drvdata(pdev);
10841056 struct imxfb_info *fbi = info->par;
10851057 struct resource *res;
@@ -1092,9 +1064,6 @@ static int imxfb_remove(struct platform_device *pdev) · 6 unmodified lines
10921064
10931065 unregister_framebuffer(info);
10941066 fb_dealloc_cmap(&info->cmap);
1095− pdata = dev_get_platdata(&pdev->dev);
1096− if (pdata && pdata->exit)
1097− pdata->exit(fbi->pdev);
10981067 dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
10991068 fbi->map_dma);
11001069 iounmap(fbi->regs);
include/linux/platform_data/video-imxfb.h+0−12
@@ -55,16 +55,4 @@ struct imx_fb_videomode { · 54 unmodified lines
5555 unsigned char bpp;
5656 };
5757
58−struct imx_fb_platform_data {
59− struct imx_fb_videomode *mode;
60− int num_modes;
61−
62− u_int pwmr;
63− u_int lscr1;
64− u_int dmacr;
65−
66− int (*init)(struct platform_device *);
67− void (*exit)(struct platform_device *);
68−};
69−
7058 #endif /* ifndef __MACH_IMXFB_H__ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t