Subject: [PATCH 2/3 V2] iio: mxs: Implement support for touchscreen

From: [email-masked] (Marek Vasut)
Date: Fri, 14 Dec 2012 03:04:43 +0100

Dear Fabio Estevam,

> Hi Marek,
> 
> On Thu, Dec 13, 2012 at 11:46 PM, Marek Vasut <[email-masked]> wrote:
> > +static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
> > +{
> > +       struct input_dev *input;
> > +       struct device *dev = lradc->dev;
> > +       int ret;
> > +
> > +       if (!lradc->use_touchscreen)
> > +               return 0;
> 
> Shouldn't we return an error code here?

No, why ? No touchscreen present, we register nothing.

> > +
> > +       input = input_allocate_device();
> > +       if (!input) {
> > +               dev_warn(dev, "Failed to allocate TS device,
> > disabling.\n"); +               lradc->use_touchscreen =
> > MXS_LRADC_TOUCHSCREEN_NONE; +               return 0;
> > +       }
> 
> Shouldn't we return an error code here?

Yes.

> Regards,
> Fabio Estevam

Best regards,
Marek Vasut