On Thu, Mar 10, 2022 at 05:16:44PM +0100, Miquel Raynal wrote: > From: Phil Edworthy <phil.edworthy@xxxxxxxxxxx> > > The 8250 driver is quite flexible. Regarding DMA handling, there is the > possibility to either use the default helper (serial8250_tx_dma()) or > call a specific function. Only the omap and brcm implementation do > that. In both cases, they don't use the serial8250_tx_dma() helper at > all. > > As we are going to write a new DMA handling function for the RZ/N1 SoCs > which will use the serial8250_tx_dma() implementation (preceded by a > couple of register writes), we need the ->tx_dma() pointer to link to > our own function, but within the __dma_tx_complete() helper we also need > to call our own implementation instead of the default one directly. > > In order to do that, let's call ->tx_dma() instead of > serial8250_tx_dma() from __dma_tx_complete(). In 8250 driver the pattern is to give the generic function "do" name and then call it in a wrapper: if (->foo()) return ->foo(); return serial8250_do_foo(); There are plenty of examples in that driver. -- With Best Regards, Andy Shevchenko