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

panel/abt-y030xx067a: Use the refcounted allocation in place of devm_kzalloc()



Move to using the new API devm_drm_panel_alloc() to allocate the
panel.

Signed-off-by: default avatarAnusha Srivatsa <asrivats@redhat.com>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250401-b4-drm-panel-mass-driver-convert-v1-1-cdd7615e1f93@redhat.com


Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
parent 5024aa7a
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -279,9 +279,10 @@ static int y030xx067a_probe(struct spi_device *spi)
	struct y030xx067a *priv;
	int err;

	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
	if (!priv)
		return -ENOMEM;
	priv = devm_drm_panel_alloc(dev, struct y030xx067a, panel,
				    &y030xx067a_funcs, DRM_MODE_CONNECTOR_DPI);
	if (IS_ERR(priv))
		return PTR_ERR(priv);

	priv->spi = spi;
	spi_set_drvdata(spi, priv);
@@ -306,9 +307,6 @@ static int y030xx067a_probe(struct spi_device *spi)
		return dev_err_probe(dev, PTR_ERR(priv->reset_gpio),
				     "Failed to get reset GPIO\n");

	drm_panel_init(&priv->panel, dev, &y030xx067a_funcs,
		       DRM_MODE_CONNECTOR_DPI);

	err = drm_panel_of_backlight(&priv->panel);
	if (err)
		return err;