Re: [PATCH 2/4] serial: 8250: export serial8250_get_baud_rate()
Andy Shevchenko <[email protected]>
| Newsgroups | org.kernel.vger.linux-serial,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo |
| Message-ID | <[email protected]> |
On Fri, Jul 10, 2026 at 10:49:27AM +0200, Christian Marangi wrote: > On Fri, Jul 10, 2026 at 11:20:48AM +0300, Andy Shevchenko wrote: > > On Thu, Jul 09, 2026 at 11:39:32PM +0200, Christian Marangi wrote: > > > On Fri, Jul 10, 2026 at 12:35:02AM +0300, Andy Shevchenko wrote: > > > > On Thu, Jul 09, 2026 at 10:56:50PM +0200, Christian Marangi wrote: > > > > > Some driver might need to access the current baud rate to correctly > > > > > configure it. > > > > > > > > > > Export the serial8250_get_baud_rate() function to limit code duplication. > > > > > > > > Why? > > > > > > > > We have _get_divisor() / _set_divisor() for exactly that purpose, no? > > > > > > I can only see set and I'm not following how that helps with any driver > > > that needs to get the baud_rate? > > > > You operate on the divisor settings instead of baud rate. Otherwise, can > > you elaborate why no other (out of dozens!) driver needs this? What do > > you try to achieve with the baud rate settings exactly? > > Ok it wasn't easy to find but you were referring to the .set_divisor and > .get_divisor. Now it's clear. Yes I guess I can use them instead of > exporting this function. > > Sorry for the noise and thanks for the suggestion! Ah, it was me a bit unclear, By _*_divisor() I referred to the wrappers on top of .set_divisor() and .get_divisor(), I should have spelled that more clearly. In any case the driver is suppose to fill callbacks and 8250 set_termios() will use that. -- With Best Regards, Andy Shevchenko