struct visionox_g2647fb105 *ctx;
int ret;
- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
- if (!ctx)
- return -ENOMEM;
+ ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
+ &visionox_g2647fb105_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
ret = devm_regulator_bulk_get_const(dev,
ARRAY_SIZE(visionox_g2647fb105_supplies),
ctx->panel.prepare_prev_first = true;
- drm_panel_init(&ctx->panel, dev, &visionox_g2647fb105_panel_funcs,
- DRM_MODE_CONNECTOR_DSI);
- ctx->panel.prepare_prev_first = true;
-
ctx->panel.backlight = visionox_g2647fb105_create_backlight(dsi);
if (IS_ERR(ctx->panel.backlight))
return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),