drm/bridge: waveshare-dsi: Fix bailout for devm_drm_bridge_alloc()

devm_drm_bridge_alloc() returns ERR_PTR on failure instead of a
NULL pointer, so use IS_ERR() to check the returned pointer and
turn proper error code on failure by using PTR_ERR().

Fixes: dbdea37add ("drm: bridge: Add waveshare DSI2DPI unit driver")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250806084121.510207-1-victor.liu@nxp.com
This commit is contained in:
Liu Ying
2025-08-06 16:41:21 +08:00
parent 0265d0ebb4
commit 3e6339a19c

View File

@@ -147,8 +147,8 @@ static int ws_bridge_probe(struct i2c_client *i2c)
int ret;
ws = devm_drm_bridge_alloc(dev, struct ws_bridge, bridge, &ws_bridge_bridge_funcs);
if (!ws)
return -ENOMEM;
if (IS_ERR(ws))
return PTR_ERR(ws);
ws->dev = dev;