[PATCH v3 05/22] drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: convert to devm_drm_bridge_alloc() API
Anusha Srivatsa
asrivats at redhat.com
Fri May 9 18:48:59 UTC 2025
On Fri, May 9, 2025 at 9:56 AM Luca Ceresoli <luca.ceresoli at bootlin.com>
wrote:
> This is the new API for allocating DRM bridges.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
>
> ---
>
> Cc: Ian Ray <ian.ray at gehealthcare.com>
> Cc: Martyn Welch <martyn.welch at collabora.co.uk>
> Cc: Peter Senna Tschudin <peter.senna at gmail.com>
>
> Changed in v3:
> - updated Ian Ray's e-mail (old one is bouncing
^^^^^^ you missed closing the breaces here.
Code changes look good.
Reviewed-by: Anusha Srivatsa <asrivats at redhat.com>
> Changed in v2: none
> ---
> drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> index
> 15a5a1f644fc10182c55bc9e489ccb81d4f924f9..81dde9ed7bcf7cacae000d9da31a3a5c347ce037
> 100644
> --- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> +++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
> @@ -225,13 +225,11 @@ static int ge_b850v3_lvds_init(struct device *dev)
> if (ge_b850v3_lvds_ptr)
> goto success;
>
> - ge_b850v3_lvds_ptr = devm_kzalloc(dev,
> - sizeof(*ge_b850v3_lvds_ptr),
> - GFP_KERNEL);
> -
> - if (!ge_b850v3_lvds_ptr) {
> + ge_b850v3_lvds_ptr = devm_drm_bridge_alloc(dev, struct
> ge_b850v3_lvds, bridge,
> + &ge_b850v3_lvds_funcs);
> + if (IS_ERR(ge_b850v3_lvds_ptr)) {
> mutex_unlock(&ge_b850v3_lvds_dev_mutex);
> - return -ENOMEM;
> + return PTR_ERR(ge_b850v3_lvds_ptr);
> }
>
> success:
> @@ -264,7 +262,6 @@ static int ge_b850v3_register(void)
> struct device *dev = &stdp4028_i2c->dev;
>
> /* drm bridge initialization */
> - ge_b850v3_lvds_ptr->bridge.funcs = &ge_b850v3_lvds_funcs;
> ge_b850v3_lvds_ptr->bridge.ops = DRM_BRIDGE_OP_DETECT |
> DRM_BRIDGE_OP_EDID;
> ge_b850v3_lvds_ptr->bridge.type = DRM_MODE_CONNECTOR_DisplayPort;
>
> --
> 2.49.0
>
> thanks,
Anusha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20250509/befdfb74/attachment-0001.htm>
More information about the dri-devel
mailing list