Re: [PATCHv2 1/2] ads7846: OMAP3: Removal of warnings backtrace in bootup

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

 



Hi,

Igor Grinberg writes:
> 
> 
> On 02/03/11 13:00, Poddar, Sourav wrote:
> 
> > On Thu, Feb 3, 2011 at 3:47 PM, Igor Grinberg <grinberg@xxxxxxxxxxxxxx> wrote:
> >> if (pdata->get_pendown_state) {
> >>        ts->get_pendown_state = pdata->get_pendown_state;
> >>        ts->gpio_pendown = -1;
> >>        return 0;
> >> }
> > Yes we can do so .I initialise it at a place where other variables
> >  where initialised.
> >
> >>> Also, why don't we use -EINVAL for the invalid gpio number instead of -1 constant?
> >>>
> >  I used -1 because conditional check done in probe ads7846_probe function
> >  used this value.
> >
> >   err_free_gpio:
> >         if (ts->gpio_pendown != -1)
> >                 gpio_free(ts->gpio_pendown);
> >
> 
> Well I understand that and that's why in my proposal I used -1 also, but
> I thought we can make it even better if we switch to -EINVAL
> (though wanted to check if there are any reasonable objections)
> and while you are at this, may be you are willing also to submit a patch for this?
> 
Since ts->gpio_pendown is used as a GPIO number, the check with
gpio_is_valid(), as suggested by Felipe Balbi, would be the most
sensible thing to do here.


Lothar WaÃmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | PascalstraÃe 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
GeschÃftsfÃhrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@xxxxxxxxxxxxxxxxxxx
___________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux