Message ID | 1361965796-16117-2-git-send-email-vikas.sajjan@linaro.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1UAfWg-0008BI-Pp; Wed, 27 Feb 2013 12:50:22 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1UAfWg-0000no-AH; Wed, 27 Feb 2013 12:50:22 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759717Ab3B0LuU (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 27 Feb 2013 06:50:20 -0500 Received: from mail-da0-f52.google.com ([209.85.210.52]:60833 "EHLO mail-da0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759656Ab3B0LuS (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 27 Feb 2013 06:50:18 -0500 Received: by mail-da0-f52.google.com with SMTP id x33so263708dad.39 for <linux-media@vger.kernel.org>; Wed, 27 Feb 2013 03:50:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=PT9wKWvsDEkq3fcJ60NS9EkaFGNLUPyc2EWRbYpjSXM=; b=B1usbJ7w9nw2hDUTPvZuiaLEJGpxaRQdULbF90FnpqSdQTsDu1cYiq4Nf3uPpoAokX 7LycDnAt8sTZB1xTn+LM7zYUuczz2E9Kp3DTb9QJliVATt4od/TDiUYP0jy6e6XF7qvp VYt6FpA+9autuVKUE0D0yL1lJUR6Vnh9W26okwDHTgoSkXayVNbec7jHTdRK4wWA7jhP rLrP7N9Oa5ecm1tbWdmQzR4MGmhb0psCDz0MrK7dJ2lW8elryKpEi989l3+qJFav9X0A RGQyEW/uInVPcAVyZL4gv+/tgfjxmG9fwO2Oy6Rx6BICBP4ElAGGpH/TDYAp4w5fGdZw tgoQ== X-Received: by 10.68.31.130 with SMTP id a2mr2760944pbi.213.1361965818439; Wed, 27 Feb 2013 03:50:18 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id vq9sm4424195pbc.36.2013.02.27.03.50.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Feb 2013 03:50:17 -0800 (PST) From: Vikas Sajjan <vikas.sajjan@linaro.org> To: dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org, kgene.kim@samsung.com, joshi@samsung.com, inki.dae@samsung.com, l.krishna@samsung.com, patches@linaro.org, linaro-dev@lists.linaro.org Subject: [PATCH v8 1/2] video: drm: exynos: Add display-timing node parsing using video helper function Date: Wed, 27 Feb 2013 17:19:55 +0530 Message-Id: <1361965796-16117-2-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1361965796-16117-1-git-send-email-vikas.sajjan@linaro.org> References: <1361965796-16117-1-git-send-email-vikas.sajjan@linaro.org> X-Gm-Message-State: ALoCoQkunNHf/+SuG/xKZuIn/PgeRDChQohidvmf8IdPOYoTDknTvnuEfBsrRc3hAM5s6RJ07+l4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.2.27.114216 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' |
Commit Message
Vikas Sajjan
Feb. 27, 2013, 11:49 a.m. UTC
Add support for parsing the display-timing node using video helper function. The DT node parsing and pinctrl selection is done only if 'dev.of_node' exists and the NON-DT logic is still maintained under the 'else' part. Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
Comments
On Wed, Feb 27, 2013 at 3:49 AM, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: > Add support for parsing the display-timing node using video helper > function. > > The DT node parsing and pinctrl selection is done only if 'dev.of_node' > exists and the NON-DT logic is still maintained under the 'else' part. > > Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> > --- > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > index 9537761..7932dc2 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > @@ -20,6 +20,7 @@ > #include <linux/of_device.h> > #include <linux/pm_runtime.h> > > +#include <video/of_display_timing.h> > #include <video/samsung_fimd.h> > #include <drm/exynos_drm.h> > > @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device *pdev) > > DRM_DEBUG_KMS("%s\n", __FILE__); > > - pdata = pdev->dev.platform_data; > - if (!pdata) { > - dev_err(dev, "no platform data specified\n"); > - return -EINVAL; > + if (pdev->dev.of_node) { > + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); > + if (!pdata) { > + DRM_ERROR("memory allocation for pdata failed\n"); > + return -ENOMEM; > + } > + > + ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing, > + OF_USE_NATIVE_MODE); > + if (ret) { > + DRM_ERROR("failed: of_get_fb_videomode()\n" > + "with return value: %d\n", ret); > + return ret; Here I think you leak pdata in the error path. Stéphane > + } > + } else { > + pdata = pdev->dev.platform_data; > + if (!pdata) { > + DRM_ERROR("no platform data specified\n"); > + return -EINVAL; > + } > } > > panel = &pdata->panel; > -- > 1.7.9.5 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Feb 27, 2013 at 11:21 AM, Stéphane Marchesin <stephane.marchesin@gmail.com> wrote: > On Wed, Feb 27, 2013 at 3:49 AM, Vikas Sajjan <vikas.sajjan@linaro.org> wrote: >> Add support for parsing the display-timing node using video helper >> function. >> >> The DT node parsing and pinctrl selection is done only if 'dev.of_node' >> exists and the NON-DT logic is still maintained under the 'else' part. >> >> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> >> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> >> --- >> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++++++++++++++++---- >> 1 file changed, 21 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> index 9537761..7932dc2 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> @@ -20,6 +20,7 @@ >> #include <linux/of_device.h> >> #include <linux/pm_runtime.h> >> >> +#include <video/of_display_timing.h> >> #include <video/samsung_fimd.h> >> #include <drm/exynos_drm.h> >> >> @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device *pdev) >> >> DRM_DEBUG_KMS("%s\n", __FILE__); >> >> - pdata = pdev->dev.platform_data; >> - if (!pdata) { >> - dev_err(dev, "no platform data specified\n"); >> - return -EINVAL; >> + if (pdev->dev.of_node) { >> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); >> + if (!pdata) { >> + DRM_ERROR("memory allocation for pdata failed\n"); >> + return -ENOMEM; >> + } >> + >> + ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing, >> + OF_USE_NATIVE_MODE); >> + if (ret) { >> + DRM_ERROR("failed: of_get_fb_videomode()\n" >> + "with return value: %d\n", ret); >> + return ret; > > Here I think you leak pdata in the error path. > Hmm nevermind it goes away with the dev. Stéphane > Stéphane > >> + } >> + } else { >> + pdata = pdev->dev.platform_data; >> + if (!pdata) { >> + DRM_ERROR("no platform data specified\n"); >> + return -EINVAL; >> + } >> } >> >> panel = &pdata->panel; >> -- >> 1.7.9.5 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 02/27/2013 08:49 PM, Vikas Sajjan wrote: > Add support for parsing the display-timing node using video helper > function. > > The DT node parsing and pinctrl selection is done only if 'dev.of_node' > exists and the NON-DT logic is still maintained under the 'else' part. > > Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> > --- > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > index 9537761..7932dc2 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > @@ -20,6 +20,7 @@ > #include <linux/of_device.h> > #include <linux/pm_runtime.h> > > +#include <video/of_display_timing.h> > #include <video/samsung_fimd.h> > #include <drm/exynos_drm.h> > > @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device *pdev) > > DRM_DEBUG_KMS("%s\n", __FILE__); > > - pdata = pdev->dev.platform_data; > - if (!pdata) { > - dev_err(dev, "no platform data specified\n"); > - return -EINVAL; > + if (pdev->dev.of_node) { > + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); > + if (!pdata) { > + DRM_ERROR("memory allocation for pdata failed\n"); > + return -ENOMEM; > + } > + > + ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing, > + OF_USE_NATIVE_MODE); > + if (ret) { > + DRM_ERROR("failed: of_get_fb_videomode()\n" > + "with return value: %d\n", ret); Could you make this error log to one line? except this, Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> > + return ret; > + } > + } else { > + pdata = pdev->dev.platform_data; > + if (!pdata) { > + DRM_ERROR("no platform data specified\n"); > + return -EINVAL; > + } > } > > panel = &pdata->panel; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, On 28 February 2013 08:07, Joonyoung Shim <jy0922.shim@samsung.com> wrote: > On 02/27/2013 08:49 PM, Vikas Sajjan wrote: >> >> Add support for parsing the display-timing node using video helper >> function. >> >> The DT node parsing and pinctrl selection is done only if 'dev.of_node' >> exists and the NON-DT logic is still maintained under the 'else' part. >> >> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> >> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> >> --- >> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 >> +++++++++++++++++++++---- >> 1 file changed, 21 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> index 9537761..7932dc2 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> @@ -20,6 +20,7 @@ >> #include <linux/of_device.h> >> #include <linux/pm_runtime.h> >> +#include <video/of_display_timing.h> >> #include <video/samsung_fimd.h> >> #include <drm/exynos_drm.h> >> @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device >> *pdev) >> DRM_DEBUG_KMS("%s\n", __FILE__); >> - pdata = pdev->dev.platform_data; >> - if (!pdata) { >> - dev_err(dev, "no platform data specified\n"); >> - return -EINVAL; >> + if (pdev->dev.of_node) { >> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); >> + if (!pdata) { >> + DRM_ERROR("memory allocation for pdata failed\n"); >> + return -ENOMEM; >> + } >> + >> + ret = of_get_fb_videomode(dev->of_node, >> &pdata->panel.timing, >> + OF_USE_NATIVE_MODE); >> + if (ret) { >> + DRM_ERROR("failed: of_get_fb_videomode()\n" >> + "with return value: %d\n", ret); > > > Could you make this error log to one line? > The Line was going beyond 80 line marks, hence I had to split it. > except this, > Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> > > >> + return ret; >> + } >> + } else { >> + pdata = pdev->dev.platform_data; >> + if (!pdata) { >> + DRM_ERROR("no platform data specified\n"); >> + return -EINVAL; >> + } >> } >> panel = &pdata->panel; > >
On 02/28/2013 11:45 AM, Vikas Sajjan wrote: > Hi, > > On 28 February 2013 08:07, Joonyoung Shim <jy0922.shim@samsung.com> wrote: >> On 02/27/2013 08:49 PM, Vikas Sajjan wrote: >>> Add support for parsing the display-timing node using video helper >>> function. >>> >>> The DT node parsing and pinctrl selection is done only if 'dev.of_node' >>> exists and the NON-DT logic is still maintained under the 'else' part. >>> >>> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> >>> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> >>> --- >>> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 >>> +++++++++++++++++++++---- >>> 1 file changed, 21 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>> index 9537761..7932dc2 100644 >>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>> @@ -20,6 +20,7 @@ >>> #include <linux/of_device.h> >>> #include <linux/pm_runtime.h> >>> +#include <video/of_display_timing.h> >>> #include <video/samsung_fimd.h> >>> #include <drm/exynos_drm.h> >>> @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device >>> *pdev) >>> DRM_DEBUG_KMS("%s\n", __FILE__); >>> - pdata = pdev->dev.platform_data; >>> - if (!pdata) { >>> - dev_err(dev, "no platform data specified\n"); >>> - return -EINVAL; >>> + if (pdev->dev.of_node) { >>> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); >>> + if (!pdata) { >>> + DRM_ERROR("memory allocation for pdata failed\n"); >>> + return -ENOMEM; >>> + } >>> + >>> + ret = of_get_fb_videomode(dev->of_node, >>> &pdata->panel.timing, >>> + OF_USE_NATIVE_MODE); >>> + if (ret) { >>> + DRM_ERROR("failed: of_get_fb_videomode()\n" >>> + "with return value: %d\n", ret); >> >> Could you make this error log to one line? >> > The Line was going beyond 80 line marks, hence I had to split it. So remove or contract some log messages, e.g. "with return value" I think that is unnecessary. >> except this, >> Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> >> >> >>> + return ret; >>> + } >>> + } else { >>> + pdata = pdev->dev.platform_data; >>> + if (!pdata) { >>> + DRM_ERROR("no platform data specified\n"); >>> + return -EINVAL; >>> + } >>> } >>> panel = &pdata->panel; >> > > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Feb 28, 2013 at 8:21 AM, Joonyoung Shim <jy0922.shim@samsung.com> wrote: > On 02/28/2013 11:45 AM, Vikas Sajjan wrote: >> >> Hi, >> >> On 28 February 2013 08:07, Joonyoung Shim <jy0922.shim@samsung.com> wrote: >>> >>> On 02/27/2013 08:49 PM, Vikas Sajjan wrote: >>>> >>>> Add support for parsing the display-timing node using video helper >>>> function. >>>> >>>> The DT node parsing and pinctrl selection is done only if 'dev.of_node' >>>> exists and the NON-DT logic is still maintained under the 'else' part. >>>> >>>> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> >>>> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> >>>> --- >>>> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 >>>> +++++++++++++++++++++---- >>>> 1 file changed, 21 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>>> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>>> index 9537761..7932dc2 100644 >>>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >>>> @@ -20,6 +20,7 @@ >>>> #include <linux/of_device.h> >>>> #include <linux/pm_runtime.h> >>>> +#include <video/of_display_timing.h> >>>> #include <video/samsung_fimd.h> >>>> #include <drm/exynos_drm.h> >>>> @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device >>>> *pdev) >>>> DRM_DEBUG_KMS("%s\n", __FILE__); >>>> - pdata = pdev->dev.platform_data; >>>> - if (!pdata) { >>>> - dev_err(dev, "no platform data specified\n"); >>>> - return -EINVAL; >>>> + if (pdev->dev.of_node) { >>>> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); >>>> + if (!pdata) { >>>> + DRM_ERROR("memory allocation for pdata >>>> failed\n"); >>>> + return -ENOMEM; >>>> + } >>>> + >>>> + ret = of_get_fb_videomode(dev->of_node, >>>> &pdata->panel.timing, >>>> + OF_USE_NATIVE_MODE); >>>> + if (ret) { >>>> + DRM_ERROR("failed: of_get_fb_videomode()\n" >>>> + "with return value: %d\n", ret); >>> >>> >>> Could you make this error log to one line? >>> >> The Line was going beyond 80 line marks, hence I had to split it. > > > So remove or contract some log messages, e.g. "with return value" > I think that is unnecessary. > Will do and resend. > >>> except this, >>> Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> >>> >>> >>>> + return ret; >>>> + } >>>> + } else { >>>> + pdata = pdev->dev.platform_data; >>>> + if (!pdata) { >>>> + DRM_ERROR("no platform data specified\n"); >>>> + return -EINVAL; >>>> + } >>>> } >>>> panel = &pdata->panel; >>> >>> >> >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..7932dc2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -20,6 +20,7 @@ #include <linux/of_device.h> #include <linux/pm_runtime.h> +#include <video/of_display_timing.h> #include <video/samsung_fimd.h> #include <drm/exynos_drm.h> @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device *pdev) DRM_DEBUG_KMS("%s\n", __FILE__); - pdata = pdev->dev.platform_data; - if (!pdata) { - dev_err(dev, "no platform data specified\n"); - return -EINVAL; + if (pdev->dev.of_node) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + DRM_ERROR("memory allocation for pdata failed\n"); + return -ENOMEM; + } + + ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing, + OF_USE_NATIVE_MODE); + if (ret) { + DRM_ERROR("failed: of_get_fb_videomode()\n" + "with return value: %d\n", ret); + return ret; + } + } else { + pdata = pdev->dev.platform_data; + if (!pdata) { + DRM_ERROR("no platform data specified\n"); + return -EINVAL; + } } panel = &pdata->panel;