All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Igor Grinberg <grinberg@compulab.co.il>
Cc: tony@atomide.com, linux-omap@vger.kernel.org,
	Hunyue Yau <hyau@mvista.com>
Subject: Re: [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2
Date: Mon, 09 May 2011 19:57:02 +0300	[thread overview]
Message-ID: <1304960222.2215.47.camel@deskari> (raw)
In-Reply-To: <4DC7A3F3.1060302@compulab.co.il>

On Mon, 2011-05-09 at 11:21 +0300, Igor Grinberg wrote:
> Hi Tomi,
> 
> On 05/09/11 10:36, Tomi Valkeinen wrote:
> 
> > Port the old omapfb panel driver to DSS2. This patch changes the board
> > file only, the driver is ported in separate patch.
> >
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Cc: Hunyue Yau <hyau@mvista.com>

<snip>

> > +static void __init sdp2430_display_init(void)
> > +{
> > +	int r;
> > +
> > +	r = gpio_request_one(SDP2430_LCD_PANEL_ENABLE_GPIO,
> > +			GPIOF_OUT_INIT_LOW, "LCD reset");
> > +	if (r) {
> > +		printk(KERN_ERR "failed to get LCD reset GPIO\n");
> > +		goto err0;
> > +	}
> > +
> > +	r = gpio_request_one(SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
> > +			GPIOF_OUT_INIT_LOW, "LCD Backlight");
> > +	if (r) {
> > +		printk(KERN_ERR "failed to get LCD backlight GPIO\n");
> 
> can both printks be pr_err?
> 
> > +		goto err1;
> > +	}
> > +
> > +	omap_display_init(&sdp2430_dss_data);
> > +
> > +	return;
> > +err1:
> > +	gpio_free(SDP2430_LCD_PANEL_ENABLE_GPIO);
> > +err0:
> > +	return;
> > +}
> 
> I think using gpio_request_array() will be much cleaner here...

Right, thanks. It turned out much cleaner:

+static void __init sdp2430_display_init(void)
+{
+       int r;
+
+       static struct gpio gpios[] __initdata = {
+               { SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
+                       "LCD reset" },
+               { SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW,
+                       "LCD Backlight" },
+       };
+
+       r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+       if (r) {
+               pr_err("Cannot request LCD GPIOs, error %d\n", r);
+               return;
+       }
+
+       omap_display_init(&sdp2430_dss_data);
+}

 Tomi




  reply	other threads:[~2011-05-09 16:57 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09  7:36 [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 1/6] OMAP: RX51: Remove unused old omapfb stuff Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 2/6] OMAP: omap3touchbook: Remove unused lcd stuff Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2 Tomi Valkeinen
2011-05-09  8:21   ` Igor Grinberg
2011-05-09 16:57     ` Tomi Valkeinen [this message]
2011-05-09  7:36 ` [PATCH 4/6] OMAP: LDP: " Tomi Valkeinen
2011-05-09  8:08   ` stanley.miao
2011-05-11  4:58   ` Janorkar, Mayuresh
2011-05-11  6:32     ` Tomi Valkeinen
2011-05-12  6:40       ` Igor Grinberg
2011-05-12  7:16         ` Igor Grinberg
2011-05-12  8:38           ` Igor Grinberg
2011-05-12  8:47             ` Janorkar, Mayuresh
2011-05-12 11:20               ` Igor Grinberg
2011-05-12 11:47                 ` Tomi Valkeinen
2011-05-12 14:36                   ` Janorkar, Mayuresh
2011-05-12 14:47                     ` Tomi Valkeinen
2011-05-12 14:50                       ` Janorkar, Mayuresh
2011-05-12 14:59                         ` Tomi Valkeinen
2011-05-16  8:53         ` Tomi Valkeinen
2011-05-16 11:13           ` Igor Grinberg
2011-05-17 11:49             ` Tomi Valkeinen
2011-05-17 11:56               ` Tomi Valkeinen
2011-05-17 12:28                 ` Igor Grinberg
2011-05-17 13:16                   ` Tomi Valkeinen
2011-05-16 11:26           ` Janorkar, Mayuresh
2011-05-17 11:44             ` Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 5/6] OMAP: H4: " Tomi Valkeinen
2011-05-09  7:36 ` [PATCH 6/6] OMAP: Apollon: " Tomi Valkeinen
2011-05-09 17:01 ` [PATCH 0/6] OMAP: board file changes for DSS2 porting Tomi Valkeinen
2011-05-10 13:35   ` Tony Lindgren
2011-05-10 14:03     ` Tomi Valkeinen
2011-05-11  7:08       ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304960222.2215.47.camel@deskari \
    --to=tomi.valkeinen@ti.com \
    --cc=grinberg@compulab.co.il \
    --cc=hyau@mvista.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.