Commit f4960b00 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull fbdev updates from Helge Deller:
 - video: Reduce code when CONFIG_HAS_IOPORT=n
 - xenfb: Fix crash by assigning fb_info->device
 - pxafb: Fix possible use after free in pxafb_task()
 - efifb: Introduce and use new devm_register_framebuffer() function
 - mmpfb: Utilize devm_clk_get_enabled() helpers
 - various typo fixes and code cleanups

* tag 'fbdev-for-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: omapfb: Fix typo in comment
  fbdev: pxafb: Fix possible use after free in pxafb_task()
  fbdev: xen-fbfront: Assign fb_info->device
  fbdev: hyperv_fb: Convert comma to semicolon
  fbdev: imsttfb: convert comma to semicolon
  fbdev: pxa3xx-gcu: Convert comma to semicolon
  fbdev: efifb: Use driver-private screen_info for sysfs
  fbdev: efifb: Use devm_register_framebuffer()
  fbdev: efifb: Register sysfs groups through driver core
  fbdev: Introduce devm_register_framebuffer()
  fbdev: omapfb: Use sysfs_emit_at() to simplify code
  fbdev: omapfb: panel-sony-acx565akm: Simplify show_cabc_available_modes()
  fbdev: mmp: Use devm_clk_get_enabled() helpers
  fbdev: hpfb: Fix an error handling path in hpfb_dio_probe()
  video: Handle HAS_IOPORT dependencies
parents eec91e22 de5e89b6
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -544,6 +544,36 @@ unregister_framebuffer(struct fb_info *fb_info)
}
EXPORT_SYMBOL(unregister_framebuffer);

static void devm_unregister_framebuffer(void *data)
{
	struct fb_info *info = data;

	unregister_framebuffer(info);
}

/**
 *	devm_register_framebuffer - resource-managed frame buffer device registration
 *	@dev: device the framebuffer belongs to
 *	@fb_info: frame buffer info structure
 *
 *	Registers a frame buffer device @fb_info to device @dev.
 *
 *	Returns negative errno on error, or zero for success.
 *
 */
int
devm_register_framebuffer(struct device *dev, struct fb_info *fb_info)
{
	int ret;

	ret = register_framebuffer(fb_info);
	if (ret)
		return ret;

	return devm_add_action_or_reset(dev, devm_unregister_framebuffer, fb_info);
}
EXPORT_SYMBOL(devm_register_framebuffer);

/**
 *	fb_set_suspend - low level driver signals suspend
 *	@info: framebuffer affected
+6 −21
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ static ssize_t name##_show(struct device *dev, \
			   struct device_attribute *attr,		\
			   char *buf)					\
{									\
	struct screen_info *si = dev_get_platdata(dev);			\
	struct screen_info *si = dev_get_drvdata(dev);			\
	if (!si)							\
		return -ENODEV;						\
	return sprintf(buf, fmt "\n", (si->lfb_##name));		\
@@ -369,6 +369,8 @@ static int efifb_probe(struct platform_device *dev)
	if (!si)
		return -ENOMEM;

	dev_set_drvdata(&dev->dev, si);

	if (si->orig_video_isVGA != VIDEO_TYPE_EFI)
		return -ENODEV;

@@ -449,7 +451,6 @@ static int efifb_probe(struct platform_device *dev)
		err = -ENOMEM;
		goto err_release_mem;
	}
	platform_set_drvdata(dev, info);
	par = info->par;
	info->pseudo_palette = par->pseudo_palette;

@@ -561,15 +562,10 @@ static int efifb_probe(struct platform_device *dev)
		break;
	}

	err = sysfs_create_groups(&dev->dev.kobj, efifb_groups);
	if (err) {
		pr_err("efifb: cannot add sysfs attrs\n");
		goto err_unmap;
	}
	err = fb_alloc_cmap(&info->cmap, 256, 0);
	if (err < 0) {
		pr_err("efifb: cannot allocate colormap\n");
		goto err_groups;
		goto err_unmap;
	}

	err = devm_aperture_acquire_for_platform_device(dev, par->base, par->size);
@@ -577,7 +573,7 @@ static int efifb_probe(struct platform_device *dev)
		pr_err("efifb: cannot acquire aperture\n");
		goto err_fb_dealloc_cmap;
	}
	err = register_framebuffer(info);
	err = devm_register_framebuffer(&dev->dev, info);
	if (err < 0) {
		pr_err("efifb: cannot register framebuffer\n");
		goto err_fb_dealloc_cmap;
@@ -587,8 +583,6 @@ static int efifb_probe(struct platform_device *dev)

err_fb_dealloc_cmap:
	fb_dealloc_cmap(&info->cmap);
err_groups:
	sysfs_remove_groups(&dev->dev.kobj, efifb_groups);
err_unmap:
	if (mem_flags & (EFI_MEMORY_UC | EFI_MEMORY_WC))
		iounmap(info->screen_base);
@@ -602,21 +596,12 @@ static int efifb_probe(struct platform_device *dev)
	return err;
}

static void efifb_remove(struct platform_device *pdev)
{
	struct fb_info *info = platform_get_drvdata(pdev);

	/* efifb_destroy takes care of info cleanup */
	unregister_framebuffer(info);
	sysfs_remove_groups(&pdev->dev.kobj, efifb_groups);
}

static struct platform_driver efifb_driver = {
	.driver = {
		.name = "efi-framebuffer",
		.dev_groups = efifb_groups,
	},
	.probe = efifb_probe,
	.remove_new = efifb_remove,
};

builtin_platform_driver(efifb_driver);
+1 −0
Original line number Diff line number Diff line
@@ -345,6 +345,7 @@ static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
	if (hpfb_init_one(paddr, vaddr)) {
		if (d->scode >= DIOII_SCBASE)
			iounmap((void *)vaddr);
		release_mem_region(d->resource.start, resource_size(&d->resource));
		return -ENOMEM;
	}
	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -1189,7 +1189,7 @@ static int hvfb_probe(struct hv_device *hdev,
	 * which is almost at the end of list, with priority = INT_MIN + 1.
	 */
	par->hvfb_panic_nb.notifier_call = hvfb_on_panic;
	par->hvfb_panic_nb.priority = INT_MIN + 10,
	par->hvfb_panic_nb.priority = INT_MIN + 10;
	atomic_notifier_chain_register(&panic_notifier_list,
				       &par->hvfb_panic_nb);

+2 −2
Original line number Diff line number Diff line
@@ -995,7 +995,7 @@ imsttfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
	bgc |= (bgc << 8);
	bgc |= (bgc << 16);

	Bpp = info->var.bits_per_pixel >> 3,
	Bpp = info->var.bits_per_pixel >> 3;
	line_pitch = info->fix.line_length;

	dy = rect->dy * line_pitch;
@@ -1036,7 +1036,7 @@ imsttfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
	__u32 Bpp, line_pitch, fb_offset_old, fb_offset_new, sp, dp_octl;
 	__u32 cnt, bltctl, sx, sy, dx, dy, height, width;

	Bpp = info->var.bits_per_pixel >> 3,
	Bpp = info->var.bits_per_pixel >> 3;

	sx = area->sx * Bpp;
	sy = area->sy;
Loading