Re: [PATCH v5 1/6] mfd: fsl imx25 Touchscreen ADC driver

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

 



On Wed, Feb 18, 2015 at 12:08:44PM +0000, Lee Jones wrote:
> On Wed, 18 Feb 2015, Fabio Estevam wrote:
> 
> > On Wed, Feb 18, 2015 at 6:01 AM, Lee Jones <lee.jones@xxxxxxxxxx> wrote:
> > > On Tue, 17 Feb 2015, Fabio Estevam wrote:
> > >
> > >> On Mon, Feb 16, 2015 at 11:38 AM, Lee Jones <lee.jones@xxxxxxxxxx> wrote:
> > >>
> > >> >> +static int mx25_tsadc_setup_irq(struct platform_device *pdev,
> > >> >> +                             struct mx25_tsadc *tsadc)
> > >> >> +{
> > >> >> +     struct device *dev = &pdev->dev;
> > >> >> +     struct device_node *np = dev->of_node;
> > >> >> +     int irq;
> > >> >> +
> > >> >> +     irq = platform_get_irq(pdev, 0);
> > >> >> +     if (irq < 0) {
> > >> >
> > >> > What if 0 is returned?
> > >>
> > >> Then  imx25.dtsi would be passing irq=0 for the ADC, which would be
> > >> totally wrong.
> > >
> > > Exactly, so it should be <=.
> > 
> > imx25.dtsi passes interrupts = <46>; for the touch screen controller,
> > so the irq number will never be zero.
> 
> It doesn't matter what happens to be passed at the moment.  The
> correct thing to do is enforce correct/full error checking.  Yes <0 is
> an error, but so is =0, so encompass it in the checks.

I now changed all irq < 0 checks to irq <= 0 under the assumption that
irq 0 is always an error.

Thanks,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: Digital signature


[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