diff mbox

drm/panel: innolux-p079zca: Use of_device_get_match_data()

Message ID 20180710110127.12315-1-thierry.reding@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding July 10, 2018, 11:01 a.m. UTC
From: Thierry Reding <treding@nvidia.com>

Use this helper to get rid of some extra boilerplate code.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Heiko Stuebner July 10, 2018, 12:41 p.m. UTC | #1
Am Dienstag, 10. Juli 2018, 13:01:27 CEST schrieb Thierry Reding:
> From: Thierry Reding <treding@nvidia.com>
> 
> Use this helper to get rid of some extra boilerplate code.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Thierry Reding July 10, 2018, 2:21 p.m. UTC | #2
On Tue, Jul 10, 2018 at 01:01:27PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Use this helper to get rid of some extra boilerplate code.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)

Applied.

Thierry
Thierry Reding July 10, 2018, 2:24 p.m. UTC | #3
On Tue, Jul 10, 2018 at 01:01:27PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Use this helper to get rid of some extra boilerplate code.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 185a55060195..62fbaac96823 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> @@ -314,14 +314,9 @@ static void innolux_panel_del(struct innolux_panel *innolux)
>  static int innolux_panel_probe(struct mipi_dsi_device *dsi)
>  {
>  	const struct panel_desc *desc;
> -	const struct of_device_id *id;
>  	int err;
>  
> -	id = of_match_node(innolux_of_match, dsi->dev.of_node);
> -	if (!id)
> -		return -ENODEV;
> -
> -	desc = id->data;
> +	desc = of_device_get_match_data(dsi->dev);
>  	dsi->mode_flags = desc->flags;
>  	dsi->format = desc->format;
>  	dsi->lanes = desc->lanes;

Oops, I just noticed I had parts of this in a stash which causes the
above to fail to build. I've squashed the missing bits into the above,
adding an include for linux/of_device.h and passing &dsi->dev instead
of dsi->dev to of_device_get_match_data().

Thierry
diff mbox

Patch

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 185a55060195..62fbaac96823 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -314,14 +314,9 @@  static void innolux_panel_del(struct innolux_panel *innolux)
 static int innolux_panel_probe(struct mipi_dsi_device *dsi)
 {
 	const struct panel_desc *desc;
-	const struct of_device_id *id;
 	int err;
 
-	id = of_match_node(innolux_of_match, dsi->dev.of_node);
-	if (!id)
-		return -ENODEV;
-
-	desc = id->data;
+	desc = of_device_get_match_data(dsi->dev);
 	dsi->mode_flags = desc->flags;
 	dsi->format = desc->format;
 	dsi->lanes = desc->lanes;