serial: 8250_dw: Call dw8250_quirks() conditionally
Subsystems (3)
Andy Shevchenko
reviewerPATCH 1/1 serial: 8250_dw: Call dw8250_quirks() conditionally
Not all the cases provide the driver data, that is represented by an object instance of struct dw8250_platform_data. Id est the change missed the case when the driver is instantiated via board files as pure platform driver. Fix this by calling dw8250_quirks() conditionally. This will require splitting dw8250_setup_dma_filter() out of dw8250_quirks().
--- drivers/tty/serial/8250/8250_dw.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-)
drivers/tty/serial/8250/8250_dw.c +17 -13
@@ -421,6 +421,18 @@ static bool dw8250_idma_filter(struct dma_chan *chan, void *param)return param == chan->device->dev; } +static void dw8250_setup_dma_filter (struct uart_port *p,struct dw8250_data *data) +{ +/* Platforms with iDMA 64-bit */ +if (platform_get_resource_byname (to_platform_device (p->dev),IORESOURCE_MEM ,"lpss_priv" )) { + data->data.dma.rx_param = p->dev->parent; + data->data.dma.tx_param = p->dev->parent; + data->data.dma.fn = dw8250_idma_filter; + }else { + data->data.dma.fn = dw8250_fallback_dma_filter; + } +} +static u32 dw8250_rzn1_get_dmacr_burst (int max_burst) {if (max_burst >=8 )
@@ -491,14 +503,6 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data) p->serial_in = dw8250_serial_in32; data->uart_16550_compatible = true; } - -/* Platforms with iDMA 64-bit */ -if (platform_get_resource_byname (to_platform_device (p->dev), -IORESOURCE_MEM ,"lpss_priv" )) { - data->data.dma.rx_param = p->dev->parent; - data->data.dma.tx_param = p->dev->parent; - data->data.dma.fn = dw8250_idma_filter; - } }static void dw8250_reset_control_assert (void *data)
@@ -532,13 +536,9 @@ static int dw8250_probe(struct platform_device *pdev)if (!data)return -ENOMEM ; - data->data.dma.fn = dw8250_fallback_dma_filter; data->pdata =device_get_match_data (p->dev); p->private_data = &data->data; - data->uart_16550_compatible =device_property_read_bool (dev, -"snps,uart-16550-compatible" ); - p->mapbase = regs->start; p->mapsize =resource_size (regs);
@@ -626,12 +626,16 @@ static int dw8250_probe(struct platform_device *pdev)if (err)return err; -dw8250_quirks (p, data); + data->uart_16550_compatible =device_property_read_bool (dev,"snps,uart-16550-compatible" ); +if (data->pdata) +dw8250_quirks (p, data);/* If the Busy Functionality is not implemented, don't handle it */ if (data->uart_16550_compatible) p->handle_irq =NULL ; +dw8250_setup_dma_filter (p, data); +if (!data->skip_autocfg)dw8250_setup_port (p);
Signature · 1 line
2.45.1.3035.g276e886db78b
Andy Shevchenko
reviewerQuoted 5 lines · Andy Shevchenko
Not all the cases provide the driver data, that is represented by an object instance of struct
dw8250_platform_data. Id est the change missed the case when the driver is instantiated via board files as pure platform driver. Fix this by callingdw8250_quirks()conditionally. This will require splittingdw8250_setup_dma_filter()out ofdw8250_quirks().
Scratch it, hit send too early, v2 is coming.
Signature · 2 lines
With Best Regards, Andy Shevchenko