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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'fbdev-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes and cleanups from Helge Deller:

- fix double free and resource leaks in imsttfb

- lots of remove callback cleanups and section mismatch fixes in
omapfb, amifb and atmel_lcdfb

- error code fix and memparse simplification in omapfb

* tag 'fbdev-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (31 commits)
fbdev: fsl-diu-fb: mark wr_reg_wa() static
fbdev: amifb: Convert to platform remove callback returning void
fbdev: amifb: Mark driver struct with __refdata to prevent section mismatch warning
fbdev: hyperv_fb: fix uninitialized local variable use
fbdev: omapfb/tpd12s015: Convert to platform remove callback returning void
fbdev: omapfb/tfp410: Convert to platform remove callback returning void
fbdev: omapfb/sharp-ls037v7dw01: Convert to platform remove callback returning void
fbdev: omapfb/opa362: Convert to platform remove callback returning void
fbdev: omapfb/hdmi: Convert to platform remove callback returning void
fbdev: omapfb/dvi: Convert to platform remove callback returning void
fbdev: omapfb/dsi-cm: Convert to platform remove callback returning void
fbdev: omapfb/dpi: Convert to platform remove callback returning void
fbdev: omapfb/analog-tv: Convert to platform remove callback returning void
fbdev: atmel_lcdfb: Convert to platform remove callback returning void
fbdev: omapfb/tpd12s015: Don't put .remove() in .exit.text and drop suppress_bind_attrs
fbdev: omapfb/tfp410: Don't put .remove() in .exit.text and drop suppress_bind_attrs
fbdev: omapfb/sharp-ls037v7dw01: Don't put .remove() in .exit.text and drop suppress_bind_attrs
fbdev: omapfb/opa362: Don't put .remove() in .exit.text and drop suppress_bind_attrs
fbdev: omapfb/hdmi: Don't put .remove() in .exit.text and drop suppress_bind_attrs
fbdev: omapfb/dvi: Don't put .remove() in .exit.text and drop suppress_bind_attrs
...

+71 -111
+9 -4
drivers/video/fbdev/amifb.c
··· 3752 3752 } 3753 3753 3754 3754 3755 - static int __exit amifb_remove(struct platform_device *pdev) 3755 + static void __exit amifb_remove(struct platform_device *pdev) 3756 3756 { 3757 3757 struct fb_info *info = platform_get_drvdata(pdev); 3758 3758 ··· 3765 3765 chipfree(); 3766 3766 framebuffer_release(info); 3767 3767 amifb_video_off(); 3768 - return 0; 3769 3768 } 3770 3769 3771 - static struct platform_driver amifb_driver = { 3772 - .remove = __exit_p(amifb_remove), 3770 + /* 3771 + * amifb_remove() lives in .exit.text. For drivers registered via 3772 + * module_platform_driver_probe() this ok because they cannot get unboud at 3773 + * runtime. The driver needs to be marked with __refdata, otherwise modpost 3774 + * triggers a section mismatch warning. 3775 + */ 3776 + static struct platform_driver amifb_driver __refdata = { 3777 + .remove_new = __exit_p(amifb_remove), 3773 3778 .driver = { 3774 3779 .name = "amiga-video", 3775 3780 },
+8 -10
drivers/video/fbdev/atmel_lcdfb.c
··· 220 220 } 221 221 } 222 222 223 - static const struct fb_fix_screeninfo atmel_lcdfb_fix __initconst = { 223 + static const struct fb_fix_screeninfo atmel_lcdfb_fix = { 224 224 .type = FB_TYPE_PACKED_PIXELS, 225 225 .visual = FB_VISUAL_TRUECOLOR, 226 226 .xpanstep = 0, ··· 841 841 atmel_lcdfb_reset(sinfo); 842 842 } 843 843 844 - static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo) 844 + static int atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo) 845 845 { 846 846 struct fb_info *info = sinfo->info; 847 847 int ret = 0; ··· 1017 1017 return ret; 1018 1018 } 1019 1019 1020 - static int __init atmel_lcdfb_probe(struct platform_device *pdev) 1020 + static int atmel_lcdfb_probe(struct platform_device *pdev) 1021 1021 { 1022 1022 struct device *dev = &pdev->dev; 1023 1023 struct fb_info *info; ··· 1223 1223 return ret; 1224 1224 } 1225 1225 1226 - static int __exit atmel_lcdfb_remove(struct platform_device *pdev) 1226 + static void atmel_lcdfb_remove(struct platform_device *pdev) 1227 1227 { 1228 1228 struct device *dev = &pdev->dev; 1229 1229 struct fb_info *info = dev_get_drvdata(dev); 1230 1230 struct atmel_lcdfb_info *sinfo; 1231 1231 1232 1232 if (!info || !info->par) 1233 - return 0; 1233 + return; 1234 1234 sinfo = info->par; 1235 1235 1236 1236 cancel_work_sync(&sinfo->task); ··· 1252 1252 } 1253 1253 1254 1254 framebuffer_release(info); 1255 - 1256 - return 0; 1257 1255 } 1258 1256 1259 1257 #ifdef CONFIG_PM ··· 1299 1301 #endif 1300 1302 1301 1303 static struct platform_driver atmel_lcdfb_driver = { 1302 - .remove = __exit_p(atmel_lcdfb_remove), 1304 + .probe = atmel_lcdfb_probe, 1305 + .remove_new = atmel_lcdfb_remove, 1303 1306 .suspend = atmel_lcdfb_suspend, 1304 1307 .resume = atmel_lcdfb_resume, 1305 1308 .driver = { ··· 1308 1309 .of_match_table = atmel_lcdfb_dt_ids, 1309 1310 }, 1310 1311 }; 1311 - 1312 - module_platform_driver_probe(atmel_lcdfb_driver, atmel_lcdfb_probe); 1312 + module_platform_driver(atmel_lcdfb_driver); 1313 1313 1314 1314 MODULE_DESCRIPTION("AT91 LCD Controller framebuffer driver"); 1315 1315 MODULE_AUTHOR("Nicolas Ferre <nicolas.ferre@atmel.com>");
+1 -1
drivers/video/fbdev/fsl-diu-fb.c
··· 490 490 * Workaround for failed writing desc register of planes. 491 491 * Needed with MPC5121 DIU rev 2.0 silicon. 492 492 */ 493 - void wr_reg_wa(u32 *reg, u32 val) 493 + static void wr_reg_wa(u32 *reg, u32 val) 494 494 { 495 495 do { 496 496 out_be32(reg, val);
+2
drivers/video/fbdev/hyperv_fb.c
··· 1013 1013 } else if (IS_ENABLED(CONFIG_SYSFB)) { 1014 1014 base = screen_info.lfb_base; 1015 1015 size = screen_info.lfb_size; 1016 + } else { 1017 + goto err1; 1016 1018 } 1017 1019 1018 1020 /*
+17 -18
drivers/video/fbdev/imsttfb.c
··· 1421 1421 if ((info->var.xres * info->var.yres) * (info->var.bits_per_pixel >> 3) > info->fix.smem_len 1422 1422 || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) { 1423 1423 printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); 1424 - framebuffer_release(info); 1425 1424 return -ENODEV; 1426 1425 } 1427 1426 ··· 1452 1453 FBINFO_HWACCEL_FILLRECT | 1453 1454 FBINFO_HWACCEL_YPAN; 1454 1455 1455 - if (fb_alloc_cmap(&info->cmap, 0, 0)) { 1456 - framebuffer_release(info); 1456 + if (fb_alloc_cmap(&info->cmap, 0, 0)) 1457 1457 return -ENODEV; 1458 - } 1459 1458 1460 1459 if (register_framebuffer(info) < 0) { 1461 1460 fb_dealloc_cmap(&info->cmap); 1462 - framebuffer_release(info); 1463 1461 return -ENODEV; 1464 1462 } 1465 1463 ··· 1496 1500 1497 1501 if (!request_mem_region(addr, size, "imsttfb")) { 1498 1502 printk(KERN_ERR "imsttfb: Can't reserve memory region\n"); 1499 - framebuffer_release(info); 1500 - return -ENODEV; 1503 + ret = -ENODEV; 1504 + goto release_info; 1501 1505 } 1502 1506 1503 1507 switch (pdev->device) { ··· 1514 1518 printk(KERN_INFO "imsttfb: Device 0x%x unknown, " 1515 1519 "contact maintainer.\n", pdev->device); 1516 1520 ret = -ENODEV; 1517 - goto error; 1521 + goto release_mem_region; 1518 1522 } 1519 1523 1520 1524 info->fix.smem_start = addr; 1521 1525 info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ? 1522 1526 0x400000 : 0x800000); 1523 1527 if (!info->screen_base) 1524 - goto error; 1528 + goto release_mem_region; 1525 1529 info->fix.mmio_start = addr + 0x800000; 1526 1530 par->dc_regs = ioremap(addr + 0x800000, 0x1000); 1527 1531 if (!par->dc_regs) 1528 - goto error; 1532 + goto unmap_screen_base; 1529 1533 par->cmap_regs_phys = addr + 0x840000; 1530 1534 par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000); 1531 1535 if (!par->cmap_regs) 1532 - goto error; 1536 + goto unmap_dc_regs; 1533 1537 info->pseudo_palette = par->palette; 1534 1538 ret = init_imstt(info); 1535 1539 if (ret) 1536 - goto error; 1540 + goto unmap_cmap_regs; 1537 1541 1538 1542 pci_set_drvdata(pdev, info); 1539 - return ret; 1543 + return 0; 1540 1544 1541 - error: 1542 - if (par->dc_regs) 1543 - iounmap(par->dc_regs); 1544 - if (info->screen_base) 1545 - iounmap(info->screen_base); 1545 + unmap_cmap_regs: 1546 + iounmap(par->cmap_regs); 1547 + unmap_dc_regs: 1548 + iounmap(par->dc_regs); 1549 + unmap_screen_base: 1550 + iounmap(info->screen_base); 1551 + release_mem_region: 1546 1552 release_mem_region(addr, size); 1553 + release_info: 1547 1554 framebuffer_release(info); 1548 1555 return ret; 1549 1556 }
+3 -5
drivers/video/fbdev/offb.c
··· 423 423 fix = &info->fix; 424 424 var = &info->var; 425 425 426 - if (name) { 427 - strcpy(fix->id, "OFfb "); 428 - strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); 429 - fix->id[sizeof(fix->id) - 1] = '\0'; 430 - } else 426 + if (name) 427 + snprintf(fix->id, sizeof(fix->id), "OFfb %s", name); 428 + else 431 429 snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp); 432 430 433 431
+11 -19
drivers/video/fbdev/omap/omapfb_main.c
··· 1643 1643 r = -ENOMEM; 1644 1644 goto cleanup; 1645 1645 } 1646 - fbdev->int_irq = platform_get_irq(pdev, 0); 1647 - if (fbdev->int_irq < 0) { 1648 - r = -ENXIO; 1649 - goto cleanup; 1650 - } 1651 1646 1652 - fbdev->ext_irq = platform_get_irq(pdev, 1); 1653 - if (fbdev->ext_irq < 0) { 1654 - r = -ENXIO; 1647 + r = platform_get_irq(pdev, 0); 1648 + if (r < 0) 1655 1649 goto cleanup; 1656 - } 1650 + fbdev->int_irq = r; 1651 + 1652 + r = platform_get_irq(pdev, 1); 1653 + if (r < 0) 1654 + goto cleanup; 1655 + fbdev->ext_irq = r; 1657 1656 1658 1657 init_state++; 1659 1658 ··· 1856 1857 if (!strncmp(this_opt, "accel", 5)) 1857 1858 def_accel = 1; 1858 1859 else if (!strncmp(this_opt, "vram:", 5)) { 1860 + unsigned long long vram; 1859 1861 char *suffix; 1860 - unsigned long vram; 1861 - vram = (simple_strtoul(this_opt + 5, &suffix, 0)); 1862 + 1863 + vram = memparse(this_opt + 5, &suffix); 1862 1864 switch (suffix[0]) { 1863 1865 case '\0': 1864 - break; 1865 - case 'm': 1866 - case 'M': 1867 - vram *= 1024; 1868 - fallthrough; 1869 - case 'k': 1870 - case 'K': 1871 - vram *= 1024; 1872 1866 break; 1873 1867 default: 1874 1868 pr_debug("omapfb: invalid vram suffix %c\n",
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c
··· 221 221 return r; 222 222 } 223 223 224 - static int __exit tvc_remove(struct platform_device *pdev) 224 + static void tvc_remove(struct platform_device *pdev) 225 225 { 226 226 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 227 227 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 233 233 tvc_disconnect(dssdev); 234 234 235 235 omap_dss_put_device(in); 236 - 237 - return 0; 238 236 } 239 237 240 238 static const struct of_device_id tvc_of_match[] = { ··· 245 247 246 248 static struct platform_driver tvc_connector_driver = { 247 249 .probe = tvc_probe, 248 - .remove = __exit_p(tvc_remove), 250 + .remove_new = tvc_remove, 249 251 .driver = { 250 252 .name = "connector-analog-tv", 251 253 .of_match_table = tvc_of_match, 252 - .suppress_bind_attrs = true, 253 254 }, 254 255 }; 255 256
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c
··· 303 303 return r; 304 304 } 305 305 306 - static int __exit dvic_remove(struct platform_device *pdev) 306 + static void dvic_remove(struct platform_device *pdev) 307 307 { 308 308 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 309 309 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 317 317 omap_dss_put_device(in); 318 318 319 319 i2c_put_adapter(ddata->i2c_adapter); 320 - 321 - return 0; 322 320 } 323 321 324 322 static const struct of_device_id dvic_of_match[] = { ··· 328 330 329 331 static struct platform_driver dvi_connector_driver = { 330 332 .probe = dvic_probe, 331 - .remove = __exit_p(dvic_remove), 333 + .remove_new = dvic_remove, 332 334 .driver = { 333 335 .name = "connector-dvi", 334 336 .of_match_table = dvic_of_match, 335 - .suppress_bind_attrs = true, 336 337 }, 337 338 }; 338 339
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c
··· 249 249 return r; 250 250 } 251 251 252 - static int __exit hdmic_remove(struct platform_device *pdev) 252 + static void hdmic_remove(struct platform_device *pdev) 253 253 { 254 254 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 255 255 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 261 261 hdmic_disconnect(dssdev); 262 262 263 263 omap_dss_put_device(in); 264 - 265 - return 0; 266 264 } 267 265 268 266 static const struct of_device_id hdmic_of_match[] = { ··· 272 274 273 275 static struct platform_driver hdmi_connector_driver = { 274 276 .probe = hdmic_probe, 275 - .remove = __exit_p(hdmic_remove), 277 + .remove_new = hdmic_remove, 276 278 .driver = { 277 279 .name = "connector-hdmi", 278 280 .of_match_table = hdmic_of_match, 279 - .suppress_bind_attrs = true, 280 281 }, 281 282 }; 282 283
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c
··· 231 231 return r; 232 232 } 233 233 234 - static int __exit opa362_remove(struct platform_device *pdev) 234 + static void opa362_remove(struct platform_device *pdev) 235 235 { 236 236 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 237 237 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 248 248 opa362_disconnect(dssdev, dssdev->dst); 249 249 250 250 omap_dss_put_device(in); 251 - 252 - return 0; 253 251 } 254 252 255 253 static const struct of_device_id opa362_of_match[] = { ··· 258 260 259 261 static struct platform_driver opa362_driver = { 260 262 .probe = opa362_probe, 261 - .remove = __exit_p(opa362_remove), 263 + .remove_new = opa362_remove, 262 264 .driver = { 263 265 .name = "amplifier-opa362", 264 266 .of_match_table = opa362_of_match, 265 - .suppress_bind_attrs = true, 266 267 }, 267 268 }; 268 269
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c
··· 217 217 return r; 218 218 } 219 219 220 - static int __exit tfp410_remove(struct platform_device *pdev) 220 + static void tfp410_remove(struct platform_device *pdev) 221 221 { 222 222 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 223 223 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 234 234 tfp410_disconnect(dssdev, dssdev->dst); 235 235 236 236 omap_dss_put_device(in); 237 - 238 - return 0; 239 237 } 240 238 241 239 static const struct of_device_id tfp410_of_match[] = { ··· 245 247 246 248 static struct platform_driver tfp410_driver = { 247 249 .probe = tfp410_probe, 248 - .remove = __exit_p(tfp410_remove), 250 + .remove_new = tfp410_remove, 249 251 .driver = { 250 252 .name = "tfp410", 251 253 .of_match_table = tfp410_of_match, 252 - .suppress_bind_attrs = true, 253 254 }, 254 255 }; 255 256
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c
··· 283 283 return r; 284 284 } 285 285 286 - static int __exit tpd_remove(struct platform_device *pdev) 286 + static void tpd_remove(struct platform_device *pdev) 287 287 { 288 288 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 289 289 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 300 300 tpd_disconnect(dssdev, dssdev->dst); 301 301 302 302 omap_dss_put_device(in); 303 - 304 - return 0; 305 303 } 306 304 307 305 static const struct of_device_id tpd_of_match[] = { ··· 311 313 312 314 static struct platform_driver tpd_driver = { 313 315 .probe = tpd_probe, 314 - .remove = __exit_p(tpd_remove), 316 + .remove_new = tpd_remove, 315 317 .driver = { 316 318 .name = "tpd12s015", 317 319 .of_match_table = tpd_of_match, 318 - .suppress_bind_attrs = true, 319 320 }, 320 321 }; 321 322
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c
··· 211 211 return r; 212 212 } 213 213 214 - static int __exit panel_dpi_remove(struct platform_device *pdev) 214 + static void panel_dpi_remove(struct platform_device *pdev) 215 215 { 216 216 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 217 217 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 223 223 panel_dpi_disconnect(dssdev); 224 224 225 225 omap_dss_put_device(in); 226 - 227 - return 0; 228 226 } 229 227 230 228 static const struct of_device_id panel_dpi_of_match[] = { ··· 234 236 235 237 static struct platform_driver panel_dpi_driver = { 236 238 .probe = panel_dpi_probe, 237 - .remove = __exit_p(panel_dpi_remove), 239 + .remove_new = panel_dpi_remove, 238 240 .driver = { 239 241 .name = "panel-dpi", 240 242 .of_match_table = panel_dpi_of_match, 241 - .suppress_bind_attrs = true, 242 243 }, 243 244 }; 244 245
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
··· 1241 1241 return r; 1242 1242 } 1243 1243 1244 - static int __exit dsicm_remove(struct platform_device *pdev) 1244 + static void dsicm_remove(struct platform_device *pdev) 1245 1245 { 1246 1246 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 1247 1247 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 1269 1269 1270 1270 /* reset, to be sure that the panel is in a valid state */ 1271 1271 dsicm_hw_reset(ddata); 1272 - 1273 - return 0; 1274 1272 } 1275 1273 1276 1274 static const struct of_device_id dsicm_of_match[] = { ··· 1280 1282 1281 1283 static struct platform_driver dsicm_driver = { 1282 1284 .probe = dsicm_probe, 1283 - .remove = __exit_p(dsicm_remove), 1285 + .remove_new = dsicm_remove, 1284 1286 .driver = { 1285 1287 .name = "panel-dsi-cm", 1286 1288 .of_match_table = dsicm_of_match, 1287 - .suppress_bind_attrs = true, 1288 1289 }, 1289 1290 }; 1290 1291
+2 -5
drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c
··· 292 292 return r; 293 293 } 294 294 295 - static int __exit sharp_ls_remove(struct platform_device *pdev) 295 + static void sharp_ls_remove(struct platform_device *pdev) 296 296 { 297 297 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 298 298 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 304 304 sharp_ls_disconnect(dssdev); 305 305 306 306 omap_dss_put_device(in); 307 - 308 - return 0; 309 307 } 310 308 311 309 static const struct of_device_id sharp_ls_of_match[] = { ··· 315 317 316 318 static struct platform_driver sharp_ls_driver = { 317 319 .probe = sharp_ls_probe, 318 - .remove = __exit_p(sharp_ls_remove), 320 + .remove_new = sharp_ls_remove, 319 321 .driver = { 320 322 .name = "panel-sharp-ls037v7dw01", 321 323 .of_match_table = sharp_ls_of_match, 322 - .suppress_bind_attrs = true, 323 324 }, 324 325 }; 325 326
+1 -8
drivers/video/fbdev/omap2/omapfb/vrfb.c
··· 368 368 return 0; 369 369 } 370 370 371 - static void __exit vrfb_remove(struct platform_device *pdev) 372 - { 373 - vrfb_loaded = false; 374 - } 375 - 376 371 static struct platform_driver vrfb_driver = { 377 372 .driver.name = "omapvrfb", 378 - .remove = __exit_p(vrfb_remove), 379 373 }; 380 - 381 - module_platform_driver_probe(vrfb_driver, vrfb_probe); 374 + builtin_platform_driver_probe(vrfb_driver, vrfb_probe); 382 375 383 376 MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>"); 384 377 MODULE_DESCRIPTION("OMAP VRFB");
+1 -1
drivers/video/fbdev/via/viafbdev.c
··· 574 574 break; 575 575 576 576 case VIAFB_SET_GAMMA_LUT: 577 - viafb_gamma_table = memdup_user(argp, 256 * sizeof(u32)); 577 + viafb_gamma_table = memdup_array_user(argp, 256, sizeof(u32)); 578 578 if (IS_ERR(viafb_gamma_table)) 579 579 return PTR_ERR(viafb_gamma_table); 580 580 viafb_set_gamma_table(viafb_bpp, viafb_gamma_table);