[v2,27/28] drm/sti: Use drm_bridge_init()
diff mbox series

Message ID 20191204114732.28514-28-mihail.atanassov@arm.com
State New
Headers show
Series
  • drm/bridge: Consolidate initialization
Related show

Commit Message

Mihail Atanassov Dec. 4, 2019, 11:48 a.m. UTC
No functional change.

v2:
 - Also apply drm_bridge_init() in sti_hdmi.c and sti_hda.c (Sam,
   Benjamin)

Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---
 drivers/gpu/drm/sti/sti_dvo.c  | 4 +---
 drivers/gpu/drm/sti/sti_hda.c  | 3 +--
 drivers/gpu/drm/sti/sti_hdmi.c | 3 +--
 3 files changed, 3 insertions(+), 7 deletions(-)

Comments

Benjamin Gaignard Dec. 5, 2019, 1:39 p.m. UTC | #1
Le mer. 4 déc. 2019 à 12:48, Mihail Atanassov
<Mihail.Atanassov@arm.com> a écrit :
>
> No functional change.
>
> v2:
>  - Also apply drm_bridge_init() in sti_hdmi.c and sti_hda.c (Sam,
>    Benjamin)
>
> Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>

Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

> ---
>  drivers/gpu/drm/sti/sti_dvo.c  | 4 +---
>  drivers/gpu/drm/sti/sti_hda.c  | 3 +--
>  drivers/gpu/drm/sti/sti_hdmi.c | 3 +--
>  3 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> index 68289b0b063a..20a3956b33bc 100644
> --- a/drivers/gpu/drm/sti/sti_dvo.c
> +++ b/drivers/gpu/drm/sti/sti_dvo.c
> @@ -462,9 +462,7 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
>         if (!bridge)
>                 return -ENOMEM;
>
> -       bridge->driver_private = dvo;
> -       bridge->funcs = &sti_dvo_bridge_funcs;
> -       bridge->of_node = dvo->dev.of_node;
> +       drm_bridge_init(bridge, &dvo->dev, &sti_dvo_bridge_funcs, NULL, dvo);
>         drm_bridge_add(bridge);
>
>         err = drm_bridge_attach(encoder, bridge, NULL);
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
> index 8f7bf33815fd..c7296e354a34 100644
> --- a/drivers/gpu/drm/sti/sti_hda.c
> +++ b/drivers/gpu/drm/sti/sti_hda.c
> @@ -699,8 +699,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
>         if (!bridge)
>                 return -ENOMEM;
>
> -       bridge->driver_private = hda;
> -       bridge->funcs = &sti_hda_bridge_funcs;
> +       drm_bridge_init(bridge, dev, &sti_hda_bridge_funcs, NULL, hda);
>         drm_bridge_attach(encoder, bridge, NULL);
>
>         connector->encoder = encoder;
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 814560ead4e1..c9ae3e18fa5d 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -1279,8 +1279,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
>         if (!bridge)
>                 return -EINVAL;
>
> -       bridge->driver_private = hdmi;
> -       bridge->funcs = &sti_hdmi_bridge_funcs;
> +       drm_bridge_init(bridge, dev, &sti_hdmi_bridge_funcs, NULL, hdmi);
>         drm_bridge_attach(encoder, bridge, NULL);
>
>         connector->encoder = encoder;
> --
> 2.23.0
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 68289b0b063a..20a3956b33bc 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -462,9 +462,7 @@  static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
 	if (!bridge)
 		return -ENOMEM;
 
-	bridge->driver_private = dvo;
-	bridge->funcs = &sti_dvo_bridge_funcs;
-	bridge->of_node = dvo->dev.of_node;
+	drm_bridge_init(bridge, &dvo->dev, &sti_dvo_bridge_funcs, NULL, dvo);
 	drm_bridge_add(bridge);
 
 	err = drm_bridge_attach(encoder, bridge, NULL);
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index 8f7bf33815fd..c7296e354a34 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -699,8 +699,7 @@  static int sti_hda_bind(struct device *dev, struct device *master, void *data)
 	if (!bridge)
 		return -ENOMEM;
 
-	bridge->driver_private = hda;
-	bridge->funcs = &sti_hda_bridge_funcs;
+	drm_bridge_init(bridge, dev, &sti_hda_bridge_funcs, NULL, hda);
 	drm_bridge_attach(encoder, bridge, NULL);
 
 	connector->encoder = encoder;
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 814560ead4e1..c9ae3e18fa5d 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -1279,8 +1279,7 @@  static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
 	if (!bridge)
 		return -EINVAL;
 
-	bridge->driver_private = hdmi;
-	bridge->funcs = &sti_hdmi_bridge_funcs;
+	drm_bridge_init(bridge, dev, &sti_hdmi_bridge_funcs, NULL, hdmi);
 	drm_bridge_attach(encoder, bridge, NULL);
 
 	connector->encoder = encoder;