mirror of
https://github.com/torvalds/linux.git
synced 2025-11-01 09:09:47 +02:00
drm/panel/novatek-nt36672a: 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: Anusha Srivatsa <asrivats@redhat.com> Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-5-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
parent
6afbf43edf
commit
a8f268ac9d
1 changed files with 5 additions and 5 deletions
|
|
@ -608,8 +608,6 @@ static int nt36672a_panel_add(struct nt36672a_panel *pinfo)
|
||||||
return dev_err_probe(dev, PTR_ERR(pinfo->reset_gpio),
|
return dev_err_probe(dev, PTR_ERR(pinfo->reset_gpio),
|
||||||
"failed to get reset gpio from DT\n");
|
"failed to get reset gpio from DT\n");
|
||||||
|
|
||||||
drm_panel_init(&pinfo->base, dev, &panel_funcs, DRM_MODE_CONNECTOR_DSI);
|
|
||||||
|
|
||||||
ret = drm_panel_of_backlight(&pinfo->base);
|
ret = drm_panel_of_backlight(&pinfo->base);
|
||||||
if (ret)
|
if (ret)
|
||||||
return dev_err_probe(dev, ret, "Failed to get backlight\n");
|
return dev_err_probe(dev, ret, "Failed to get backlight\n");
|
||||||
|
|
@ -625,9 +623,11 @@ static int nt36672a_panel_probe(struct mipi_dsi_device *dsi)
|
||||||
const struct nt36672a_panel_desc *desc;
|
const struct nt36672a_panel_desc *desc;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
pinfo = devm_kzalloc(&dsi->dev, sizeof(*pinfo), GFP_KERNEL);
|
pinfo = devm_drm_panel_alloc(&dsi->dev, __typeof(*pinfo), base,
|
||||||
if (!pinfo)
|
&panel_funcs, DRM_MODE_CONNECTOR_DSI);
|
||||||
return -ENOMEM;
|
|
||||||
|
if (IS_ERR(pinfo))
|
||||||
|
return PTR_ERR(pinfo);
|
||||||
|
|
||||||
desc = of_device_get_match_data(&dsi->dev);
|
desc = of_device_get_match_data(&dsi->dev);
|
||||||
dsi->mode_flags = desc->mode_flags;
|
dsi->mode_flags = desc->mode_flags;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue