Skip to content

Commit 26e8349

Browse files
andy-shevgregkh
authored andcommitted
serial: 8250_uniphier: Switch to use uart_read_port_properties()
Since we have now a common helper to read port properties use it instead of sparse home grown solution. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Tested-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Link: https://lore.kernel.org/r/20240304123035.758700-15-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 266bc29 commit 26e8349

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

drivers/tty/serial/8250/8250_uniphier.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ static int uniphier_uart_probe(struct platform_device *pdev)
162162
struct uniphier8250_priv *priv;
163163
struct resource *regs;
164164
void __iomem *membase;
165-
int irq;
166165
int ret;
167166

168167
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -175,23 +174,12 @@ static int uniphier_uart_probe(struct platform_device *pdev)
175174
if (!membase)
176175
return -ENOMEM;
177176

178-
irq = platform_get_irq(pdev, 0);
179-
if (irq < 0)
180-
return irq;
181-
182177
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
183178
if (!priv)
184179
return -ENOMEM;
185180

186181
memset(&up, 0, sizeof(up));
187182

188-
ret = of_alias_get_id(dev->of_node, "serial");
189-
if (ret < 0) {
190-
dev_err(dev, "failed to get alias id\n");
191-
return ret;
192-
}
193-
up.port.line = ret;
194-
195183
priv->clk = devm_clk_get(dev, NULL);
196184
if (IS_ERR(priv->clk)) {
197185
dev_err(dev, "failed to get clock\n");
@@ -211,7 +199,10 @@ static int uniphier_uart_probe(struct platform_device *pdev)
211199
up.port.mapbase = regs->start;
212200
up.port.mapsize = resource_size(regs);
213201
up.port.membase = membase;
214-
up.port.irq = irq;
202+
203+
ret = uart_read_port_properties(&up.port);
204+
if (ret)
205+
return ret;
215206

216207
up.port.type = PORT_16550A;
217208
up.port.iotype = UPIO_MEM32;

0 commit comments

Comments
 (0)