Re: [PATCH v3 2/4] gpiolib: add gpiod_get_array and gpiod_put_array functions

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

 



On Tuesday 10 February 2015 14:41:18 Mika Westerberg wrote:
> On Tue, Feb 10, 2015 at 01:21:19PM +0100, Rojhalat Ibrahim wrote:
> > On Tuesday 10 February 2015 12:40:34 Mika Westerberg wrote:
> > 
> > > > +
> > > > +	for (descs->array_size = 0; descs->array_size < count; ) {
> > >                                                               ^
> > >                                                               |
> > >                                                               +-- extra whitespace
> > > 
> > > > +		desc = gpiod_get_index(dev, con_id, descs->array_size, flags);
> > > > +		if (IS_ERR(desc)) {
> > > > +			gpiod_put_array(descs);
> > > > +			return ERR_PTR(PTR_ERR(desc));
> > > 
> > > Uh, why not
> > > 
> > > 	return desc
> > > 
> > > ?
> > 
> > Because of the different pointer type. desc is a pointer to a GPIO descriptor
> > whereas the return type of the function is a pointer to struct gpio_descs.
> 
> Right. I wonder if ERR_CAST() may be used here.
> 

Didn't know about that one. I'll use it in the next revision.

Thanks for looking at this.


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




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux