[00/18] serial: max310x: cleanups and improvements

Message ID 20240117223856.2303475-1-hugo@hugovil.com
Headers
Series serial: max310x: cleanups and improvements |

Message

Hugo Villeneuve Jan. 17, 2024, 10:38 p.m. UTC
  From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Hello,
this patch series brings a few clean-ups and improvements to the max310x
driver.

Some of these changes are based on suggestions for the sc16is7xx driver by
Andy Shevchenko following this dicussion:

Link: https://lore.kernel.org/all/CAHp75VebCZckUrNraYQj9k=Mrn2kbYs1Lx26f5-8rKJ3RXeh-w@mail.gmail.com/

The changes have been tested on a custom board using a max14830 in SPI
mode, with an external oscillator (not crystal). Tests included a simple
communication test with a GPS connected to UART0.

They also have been tested by using i2c-stub to simulate the four ports on a
virtual I2C max14830 device, but with obvious limitations as this cannot
simulate all the hardware functions.

Thank you.

Hugo Villeneuve (18):
  serial: max310x: fix NULL pointer dereference in I2C instantiation
  serial: max310x: add I2C device table for instantiation from userspace
  serial: max310x: use i2c_get_match_data()
  serial: max310x: use spi_get_device_match_data()
  serial: max310x: fix syntax error in IRQ error message
  serial: max310x: remove holes in struct max310x_devtype
  serial: max310x: add macro for max number of ports
  serial: max310x: use separate regmap name for each port
  serial: max310x: simplify probe() and remove() error handling
  serial: max310x: add explicit return for some switch default cases
  serial: max310x: use dev_err_probe() instead of dev_err()
  serial: max310x: replace hardcoded masks with preferred GENMASK()
  serial: max310x: use common detect function for all variants
  serial: max310x: use common power function for all variants
  serial: max310x: replace ENOTSUPP with preferred EOPNOTSUPP
    (checkpatch)
  serial: max310x: replace bare use of 'unsigned' with 'unsigned int'
    (checkpatch)
  serial: max310x: reformat and improve comments
  serial: max310x: fix indentation

 drivers/tty/serial/max310x.c | 329 ++++++++++++++++++-----------------
 1 file changed, 165 insertions(+), 164 deletions(-)


base-commit: 0c84bea0cabc4e2b98a3de88eeb4ff798931f056
  

Comments

Andy Shevchenko Jan. 17, 2024, 11:26 p.m. UTC | #1
On Thu, Jan 18, 2024 at 12:39 AM Hugo Villeneuve <hugo@hugovil.com> wrote:
>
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
>
> Hello,
> this patch series brings a few clean-ups and improvements to the max310x
> driver.
>
> Some of these changes are based on suggestions for the sc16is7xx driver by
> Andy Shevchenko following this dicussion:

discussion

> Link: https://lore.kernel.org/all/CAHp75VebCZckUrNraYQj9k=Mrn2kbYs1Lx26f5-8rKJ3RXeh-w@mail.gmail.com/

Perhaps you may add Suggested-by to the related changes.

> The changes have been tested on a custom board using a max14830 in SPI
> mode, with an external oscillator (not crystal). Tests included a simple
> communication test with a GPS connected to UART0.
>
> They also have been tested by using i2c-stub to simulate the four ports on a
> virtual I2C max14830 device, but with obvious limitations as this cannot
> simulate all the hardware functions.

..

LGTM, except this one (I have commented individually)
>   serial: max310x: replace ENOTSUPP with preferred EOPNOTSUPP
>     (checkpatch)

So, for the rest
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
  
Hugo Villeneuve Jan. 18, 2024, midnight UTC | #2
Hi,

On Thu, 18 Jan 2024 01:26:59 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Thu, Jan 18, 2024 at 12:39 AM Hugo Villeneuve <hugo@hugovil.com> wrote:
> >
> > From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> >
> > Hello,
> > this patch series brings a few clean-ups and improvements to the max310x
> > driver.
> >
> > Some of these changes are based on suggestions for the sc16is7xx driver by
> > Andy Shevchenko following this dicussion:
> 
> discussion

Will fix in V2.

> 
> > Link: https://lore.kernel.org/all/CAHp75VebCZckUrNraYQj9k=Mrn2kbYs1Lx26f5-8rKJ3RXeh-w@mail.gmail.com/
> 
> Perhaps you may add Suggested-by to the related changes.

Ok, will do for some of the patches in V2.


> > The changes have been tested on a custom board using a max14830 in SPI
> > mode, with an external oscillator (not crystal). Tests included a simple
> > communication test with a GPS connected to UART0.
> >
> > They also have been tested by using i2c-stub to simulate the four ports on a
> > virtual I2C max14830 device, but with obvious limitations as this cannot
> > simulate all the hardware functions.
> 
> ...
> 
> LGTM, except this one (I have commented individually)
> >   serial: max310x: replace ENOTSUPP with preferred EOPNOTSUPP
> >     (checkpatch)
> 
> So, for the rest
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Thank you for the review,
Hugo Villeneuve