@@ -19,7 +19,7 @@
#include <drm/drm_crtc_helper.h>
struct tfp410 {
- struct drm_bridge bridge;
+ struct drm_bridge *bridge;
struct drm_connector connector;
struct i2c_adapter *ddc;
@@ -30,7 +30,7 @@ struct tfp410 {
static inline struct tfp410 *
drm_bridge_to_tfp410(struct drm_bridge *bridge)
{
- return container_of(bridge, struct tfp410, bridge);
+ return bridge->driver_private;
}
static inline struct tfp410 *
@@ -171,16 +171,18 @@ static int tfp410_init(struct device *dev)
if (!dvi)
return -ENOMEM;
dev_set_drvdata(dev, dvi);
+ dvi->bridge = drm_bridge_alloc(THIS_MODULE);
+ dvi->bridge->driver_private = dvi;
- dvi->bridge.funcs = &tfp410_bridge_funcs;
- dvi->bridge.of_node = dev->of_node;
+ dvi->bridge->funcs = &tfp410_bridge_funcs;
+ dvi->bridge->of_node = dev->of_node;
dvi->dev = dev;
ret = tfp410_get_connector_ddc(dvi);
if (ret)
goto fail;
- ret = drm_bridge_add(&dvi->bridge);
+ ret = drm_bridge_add(dvi->bridge);
if (ret) {
dev_err(dev, "drm_bridge_add() failed: %d\n", ret);
goto fail;
@@ -196,11 +198,13 @@ static int tfp410_fini(struct device *dev)
{
struct tfp410 *dvi = dev_get_drvdata(dev);
- drm_bridge_remove(&dvi->bridge);
+ drm_bridge_remove(dvi->bridge);
if (dvi->ddc)
i2c_put_adapter(dvi->ddc);
+ drm_bridge_put(dvi->bridge);
+
return 0;
}
Signed-off-by: Jyri Sarha <jsarha@ti.com> --- drivers/gpu/drm/bridge/ti-tfp410.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)