Commit 18553507 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents c0d12d76 a5035c81
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -3752,7 +3752,7 @@ static int __init amifb_probe(struct platform_device *pdev)
}


static int __exit amifb_remove(struct platform_device *pdev)
static void __exit amifb_remove(struct platform_device *pdev)
{
	struct fb_info *info = platform_get_drvdata(pdev);

@@ -3765,11 +3765,16 @@ static int __exit amifb_remove(struct platform_device *pdev)
	chipfree();
	framebuffer_release(info);
	amifb_video_off();
	return 0;
}

static struct platform_driver amifb_driver = {
	.remove = __exit_p(amifb_remove),
/*
 * amifb_remove() lives in .exit.text. For drivers registered via
 * module_platform_driver_probe() this ok because they cannot get unboud at
 * runtime. The driver needs to be marked with __refdata, otherwise modpost
 * triggers a section mismatch warning.
 */
static struct platform_driver amifb_driver __refdata = {
	.remove_new = __exit_p(amifb_remove),
	.driver   = {
		.name	= "amiga-video",
	},
+8 −10
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int
	}
}

static const struct fb_fix_screeninfo atmel_lcdfb_fix __initconst = {
static const struct fb_fix_screeninfo atmel_lcdfb_fix = {
	.type		= FB_TYPE_PACKED_PIXELS,
	.visual		= FB_VISUAL_TRUECOLOR,
	.xpanstep	= 0,
@@ -841,7 +841,7 @@ static void atmel_lcdfb_task(struct work_struct *work)
	atmel_lcdfb_reset(sinfo);
}

static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
static int atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
{
	struct fb_info *info = sinfo->info;
	int ret = 0;
@@ -1017,7 +1017,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
	return ret;
}

static int __init atmel_lcdfb_probe(struct platform_device *pdev)
static int atmel_lcdfb_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct fb_info *info;
@@ -1223,14 +1223,14 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
	return ret;
}

static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
static void atmel_lcdfb_remove(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct fb_info *info = dev_get_drvdata(dev);
	struct atmel_lcdfb_info *sinfo;

	if (!info || !info->par)
		return 0;
		return;
	sinfo = info->par;

	cancel_work_sync(&sinfo->task);
@@ -1252,8 +1252,6 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
	}

	framebuffer_release(info);

	return 0;
}

#ifdef CONFIG_PM
@@ -1301,7 +1299,8 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
#endif

static struct platform_driver atmel_lcdfb_driver = {
	.remove		= __exit_p(atmel_lcdfb_remove),
	.probe		= atmel_lcdfb_probe,
	.remove_new	= atmel_lcdfb_remove,
	.suspend	= atmel_lcdfb_suspend,
	.resume		= atmel_lcdfb_resume,
	.driver		= {
@@ -1309,8 +1308,7 @@ static struct platform_driver atmel_lcdfb_driver = {
		.of_match_table	= atmel_lcdfb_dt_ids,
	},
};

module_platform_driver_probe(atmel_lcdfb_driver, atmel_lcdfb_probe);
module_platform_driver(atmel_lcdfb_driver);

MODULE_DESCRIPTION("AT91 LCD Controller framebuffer driver");
MODULE_AUTHOR("Nicolas Ferre <nicolas.ferre@atmel.com>");
+1 −1
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
 * Workaround for failed writing desc register of planes.
 * Needed with MPC5121 DIU rev 2.0 silicon.
 */
void wr_reg_wa(u32 *reg, u32 val)
static void wr_reg_wa(u32 *reg, u32 val)
{
	do {
		out_be32(reg, val);
+2 −0
Original line number Diff line number Diff line
@@ -1013,6 +1013,8 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
	} else if (IS_ENABLED(CONFIG_SYSFB)) {
		base = screen_info.lfb_base;
		size = screen_info.lfb_size;
	} else {
		goto err1;
	}

	/*
+17 −18
Original line number Diff line number Diff line
@@ -1421,7 +1421,6 @@ static int init_imstt(struct fb_info *info)
	if ((info->var.xres * info->var.yres) * (info->var.bits_per_pixel >> 3) > info->fix.smem_len
	    || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) {
		printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel);
		framebuffer_release(info);
		return -ENODEV;
	}

@@ -1453,14 +1452,11 @@ static int init_imstt(struct fb_info *info)
	              FBINFO_HWACCEL_FILLRECT |
	              FBINFO_HWACCEL_YPAN;

	if (fb_alloc_cmap(&info->cmap, 0, 0)) {
		framebuffer_release(info);
	if (fb_alloc_cmap(&info->cmap, 0, 0))
		return -ENODEV;
	}

	if (register_framebuffer(info) < 0) {
		fb_dealloc_cmap(&info->cmap);
		framebuffer_release(info);
		return -ENODEV;
	}

@@ -1500,8 +1496,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

	if (!request_mem_region(addr, size, "imsttfb")) {
		printk(KERN_ERR "imsttfb: Can't reserve memory region\n");
		framebuffer_release(info);
		return -ENODEV;
		ret = -ENODEV;
		goto release_info;
	}

	switch (pdev->device) {
@@ -1518,36 +1514,39 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
			printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
					 "contact maintainer.\n", pdev->device);
			ret = -ENODEV;
			goto error;
			goto release_mem_region;
	}

	info->fix.smem_start = addr;
	info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ?
					    0x400000 : 0x800000);
	if (!info->screen_base)
		goto error;
		goto release_mem_region;
	info->fix.mmio_start = addr + 0x800000;
	par->dc_regs = ioremap(addr + 0x800000, 0x1000);
	if (!par->dc_regs)
		goto error;
		goto unmap_screen_base;
	par->cmap_regs_phys = addr + 0x840000;
	par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000);
	if (!par->cmap_regs)
		goto error;
		goto unmap_dc_regs;
	info->pseudo_palette = par->palette;
	ret = init_imstt(info);
	if (ret)
		goto error;
		goto unmap_cmap_regs;

	pci_set_drvdata(pdev, info);
	return ret;
	return 0;

error:
	if (par->dc_regs)
unmap_cmap_regs:
	iounmap(par->cmap_regs);
unmap_dc_regs:
	iounmap(par->dc_regs);
	if (info->screen_base)
unmap_screen_base:
	iounmap(info->screen_base);
release_mem_region:
	release_mem_region(addr, size);
release_info:
	framebuffer_release(info);
	return ret;
}
Loading