diff options
Diffstat (limited to 'drivers/gpu/drm/bridge/thc63lvd1024.c')
| -rw-r--r-- | drivers/gpu/drm/bridge/thc63lvd1024.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c index bba10cf9b4f9..c804222846c3 100644 --- a/drivers/gpu/drm/bridge/thc63lvd1024.c +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c @@ -32,7 +32,6 @@ struct thc63_dev { struct gpio_desc *oe; struct drm_bridge bridge; - struct drm_bridge *next; struct drm_bridge_timings timings; }; @@ -43,11 +42,12 @@ static inline struct thc63_dev *to_thc63(struct drm_bridge *bridge) } static int thc63_attach(struct drm_bridge *bridge, + struct drm_encoder *encoder, enum drm_bridge_attach_flags flags) { struct thc63_dev *thc63 = to_thc63(bridge); - return drm_bridge_attach(bridge->encoder, thc63->next, bridge, flags); + return drm_bridge_attach(encoder, thc63->bridge.next_bridge, bridge, flags); } static enum drm_mode_status thc63_mode_valid(struct drm_bridge *bridge, @@ -131,9 +131,9 @@ static int thc63_parse_dt(struct thc63_dev *thc63) return -ENODEV; } - thc63->next = of_drm_find_bridge(remote); + thc63->bridge.next_bridge = of_drm_find_and_get_bridge(remote); of_node_put(remote); - if (!thc63->next) + if (!thc63->bridge.next_bridge) return -EPROBE_DEFER; endpoint = of_graph_get_endpoint_by_regs(thc63->dev->of_node, @@ -180,9 +180,10 @@ static int thc63_probe(struct platform_device *pdev) struct thc63_dev *thc63; int ret; - thc63 = devm_kzalloc(&pdev->dev, sizeof(*thc63), GFP_KERNEL); - if (!thc63) - return -ENOMEM; + thc63 = devm_drm_bridge_alloc(&pdev->dev, struct thc63_dev, bridge, + &thc63_bridge_func); + if (IS_ERR(thc63)) + return PTR_ERR(thc63); thc63->dev = &pdev->dev; platform_set_drvdata(pdev, thc63); @@ -207,7 +208,6 @@ static int thc63_probe(struct platform_device *pdev) thc63->bridge.driver_private = thc63; thc63->bridge.of_node = pdev->dev.of_node; - thc63->bridge.funcs = &thc63_bridge_func; thc63->bridge.timings = &thc63->timings; drm_bridge_add(&thc63->bridge); |
