diff mbox series

[4/5] drm/panel: deprecate old-style panel allocation

Message ID 20250325-b4-panel-refcounting-v1-4-4e2bf5d19c5d@redhat.com (mailing list archive)
State New, archived
Headers show
Series drm/panel: Panel Refcounting infrastructure | expand

Commit Message

Anusha Srivatsa March 25, 2025, 5:24 p.m. UTC
Start moving to the new refcounted allocations using
the new API devm_drm_panel_alloc(). Deprecate any other
allocation.

Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
---
 drivers/gpu/drm/drm_panel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Luca Ceresoli March 26, 2025, 9:23 a.m. UTC | #1
On Tue, 25 Mar 2025 13:24:11 -0400
Anusha Srivatsa <asrivats@redhat.com> wrote:

> Start moving to the new refcounted allocations using
> the new API devm_drm_panel_alloc(). Deprecate any other
> allocation.
> 
> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Maxime Ripard March 26, 2025, 3:32 p.m. UTC | #2
On Tue, Mar 25, 2025 at 01:24:11PM -0400, Anusha Srivatsa wrote:
> Start moving to the new refcounted allocations using
> the new API devm_drm_panel_alloc(). Deprecate any other
> allocation.
> 
> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
> ---
>  drivers/gpu/drm/drm_panel.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> index 11a0415bc61f59190ef5eb378d1583c493265e6a..5793011f4938a2d4fb9d84a700817bda317af305 100644
> --- a/drivers/gpu/drm/drm_panel.c
> +++ b/drivers/gpu/drm/drm_panel.c
> @@ -74,8 +74,10 @@ EXPORT_SYMBOL(drm_panel_init);
>   * drm_panel_add - add a panel to the global registry
>   * @panel: panel to add
>   *
> - * Add a panel to the global registry so that it can be looked up by display
> - * drivers.
> + * Add a panel to the global registry so that it can be looked
> + * up by display drivers. The panel to be added must have been
> + * allocated by devm_drm_panel_alloc(). Old-style allocation by
> + * kzalloc(), devm_kzalloc() and similar is deprecated.

It's not that it's deprecated, it's that it's unsafe. Since you already
said that the allocation must be done through devm_drm_panel_alloc(),
there's not much use to mention the old style stuff, I'd just drop the
last sentence.

Maxime
Anusha Srivatsa March 26, 2025, 4:59 p.m. UTC | #3
On Wed, Mar 26, 2025 at 11:32 AM Maxime Ripard <mripard@kernel.org> wrote:

> On Tue, Mar 25, 2025 at 01:24:11PM -0400, Anusha Srivatsa wrote:
> > Start moving to the new refcounted allocations using
> > the new API devm_drm_panel_alloc(). Deprecate any other
> > allocation.
> >
> > Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
> > ---
> >  drivers/gpu/drm/drm_panel.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> > index
> 11a0415bc61f59190ef5eb378d1583c493265e6a..5793011f4938a2d4fb9d84a700817bda317af305
> 100644
> > --- a/drivers/gpu/drm/drm_panel.c
> > +++ b/drivers/gpu/drm/drm_panel.c
> > @@ -74,8 +74,10 @@ EXPORT_SYMBOL(drm_panel_init);
> >   * drm_panel_add - add a panel to the global registry
> >   * @panel: panel to add
> >   *
> > - * Add a panel to the global registry so that it can be looked up by
> display
> > - * drivers.
> > + * Add a panel to the global registry so that it can be looked
> > + * up by display drivers. The panel to be added must have been
> > + * allocated by devm_drm_panel_alloc(). Old-style allocation by
> > + * kzalloc(), devm_kzalloc() and similar is deprecated.
>
> It's not that it's deprecated, it's that it's unsafe. Since you already
> said that the allocation must be done through devm_drm_panel_alloc(),
> there's not much use to mention the old style stuff, I'd just drop the
> last sentence.
>
>
Alrighty.

Thanks,
Anusha

> Maxime
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index 11a0415bc61f59190ef5eb378d1583c493265e6a..5793011f4938a2d4fb9d84a700817bda317af305 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -74,8 +74,10 @@  EXPORT_SYMBOL(drm_panel_init);
  * drm_panel_add - add a panel to the global registry
  * @panel: panel to add
  *
- * Add a panel to the global registry so that it can be looked up by display
- * drivers.
+ * Add a panel to the global registry so that it can be looked
+ * up by display drivers. The panel to be added must have been
+ * allocated by devm_drm_panel_alloc(). Old-style allocation by
+ * kzalloc(), devm_kzalloc() and similar is deprecated.
  */
 void drm_panel_add(struct drm_panel *panel)
 {