lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 297/779] drm/vc4: dsi: Switch to devm_drm_of_get_bridge
    Date
    From: Maxime Ripard <maxime@cerno.tech>

    [ Upstream commit a43dd76bacd0d5441a4c84f60d64bdfaedc95bac ]

    The new devm_drm_of_get_bridge removes most of the boilerplate we
    have to deal with. Let's switch to it.

    Signed-off-by: Maxime Ripard <maxime@cerno.tech>
    Acked-by: Sam Ravnborg <sam@ravnborg.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210910130941.1740182-4-maxime@cerno.tech
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/gpu/drm/vc4/vc4_dsi.c | 28 ++++------------------------
    1 file changed, 4 insertions(+), 24 deletions(-)

    diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
    index ca8506316660..64dfefeb03f5 100644
    --- a/drivers/gpu/drm/vc4/vc4_dsi.c
    +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
    @@ -1493,7 +1493,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
    struct drm_device *drm = dev_get_drvdata(master);
    struct vc4_dsi *dsi = dev_get_drvdata(dev);
    struct vc4_dsi_encoder *vc4_dsi_encoder;
    - struct drm_panel *panel;
    const struct of_device_id *match;
    dma_cap_mask_t dma_mask;
    int ret;
    @@ -1605,27 +1604,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
    return ret;
    }

    - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
    - &panel, &dsi->bridge);
    - if (ret) {
    - /* If the bridge or panel pointed by dev->of_node is not
    - * enabled, just return 0 here so that we don't prevent the DRM
    - * dev from being registered. Of course that means the DSI
    - * encoder won't be exposed, but that's not a problem since
    - * nothing is connected to it.
    - */
    - if (ret == -ENODEV)
    - return 0;
    -
    - return ret;
    - }
    -
    - if (panel) {
    - dsi->bridge = devm_drm_panel_bridge_add_typed(dev, panel,
    - DRM_MODE_CONNECTOR_DSI);
    - if (IS_ERR(dsi->bridge))
    - return PTR_ERR(dsi->bridge);
    - }
    + dsi->bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0);
    + if (IS_ERR(dsi->bridge))
    + return PTR_ERR(dsi->bridge);

    /* The esc clock rate is supposed to always be 100Mhz. */
    ret = clk_set_rate(dsi->escape_clock, 100 * 1000000);
    @@ -1663,8 +1644,7 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master,
    {
    struct vc4_dsi *dsi = dev_get_drvdata(dev);

    - if (dsi->bridge)
    - pm_runtime_disable(dev);
    + pm_runtime_disable(dev);

    /*
    * Restore the bridge_chain so the bridge detach procedure can happen
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-08-15 20:59    [W:2.501 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site