Re: [PATCH v5 1/3] tty/serial: Add GPIOLIB helpers for controlling modem lines

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

 



Hello.

Вторник,  4 марта 2014, 12:37 +01:00 от Richard Genoud <richard.genoud@xxxxxxxxx>:
> 2014-03-03 12:27 GMT+01:00 Alexander Shiyan <shc_work@xxxxxxx>:
> > Hello.
> >
> > Понедельник,  3 марта 2014, 12:11 +01:00 от Richard Genoud <noreply.rgenoud@xxxxxxxxx>:
> >> This patch add some helpers to control modem lines (CTS/RTS/DSR...) via
> >> GPIO.
> >> This will be useful for many boards which have a serial controller that
> >> only handle CTS/RTS pins (or even just RX/TX).
> >>
> >> Signed-off-by: Richard Genoud <richard.genoud@xxxxxxxxx>
> > ...
> >> +struct mctrl_gpios *mctrl_gpio_init(struct device *dev, unsigned int idx)
> >> +{
> >> +     struct mctrl_gpios *gpios;
> >> +     enum mctrl_gpio_idx i;
> >> +     int err;
> >> +
> >> +     gpios = devm_kzalloc(dev, sizeof(*gpios), GFP_KERNEL);
> >> +     if (!gpios)
> >> +             goto out;
> >
> > if (!gpios)
> >   return ERR_PTR(-ENOMEM);
> I think we are looping here...
> If I returns a ERR_PTR(-ENOMEM), I'll have to change back all tests
> from if (!gpios) to if (IS_ERR_OR_NULL(gpios))
> So, I'll just return NULL here, and change the test in atmel_serial.c
> (that was wrong anyway, as you pointed out)

Yes, a little confused :)
So, let's revert back to check IS_ERR_OR_NULL(gpios).
We able to check error codes in the driver in this case.
gpios = NULL at the end of mctrl_gpio_free() is still needed.

---
��.n��������+%������w��{.n�����{��ǫ����{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux