Re: [PATCH 3/6] OMAP: 2420SDP: Port the display driver to new DSS2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
> > Cc: Hunyue Yau <hyau@xxxxxxxxxx>

<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



--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux