Unverified Commit d29ab79c authored by Anusha Srivatsa's avatar Anusha Srivatsa Committed by Maxime Ripard
Browse files

drm/panel/lpm102a188a: Use refcounted allocation in place of devm_kzalloc()



Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.

Signed-off-by: default avatarAnusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-10-de73ba81b2f5@redhat.com


Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
parent b669ce70
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -435,9 +435,6 @@ static int jdi_panel_add(struct jdi_panel *jdi)
		return dev_err_probe(dev, PTR_ERR(jdi->backlight),
				     "failed to create backlight\n");

	drm_panel_init(&jdi->base, &jdi->link1->dev, &jdi_panel_funcs,
		       DRM_MODE_CONNECTOR_DSI);

	drm_panel_add(&jdi->base);

	return 0;
@@ -475,10 +472,13 @@ static int jdi_panel_dsi_probe(struct mipi_dsi_device *dsi)

	/* register a panel for only the DSI-LINK1 interface */
	if (secondary) {
		jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL);
		if (!jdi) {
		jdi = devm_drm_panel_alloc(&dsi->dev, __typeof(*jdi),
					   base, &jdi_panel_funcs,
					   DRM_MODE_CONNECTOR_DSI);

		if (IS_ERR(jdi)) {
			put_device(&secondary->dev);
			return -ENOMEM;
			return PTR_ERR(jdi);
		}

		mipi_dsi_set_drvdata(dsi, jdi);