Skip to content

Commit 618bf2b

Browse files
Tang Bingregkh
authored andcommitted
serial: 8250_ingenic: Use of_device_get_match_data
Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Acked-by: Paul Cercueil <[email protected]> Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fa934fc commit 618bf2b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/tty/serial/8250/8250_ingenic.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,14 @@ static int ingenic_uart_probe(struct platform_device *pdev)
209209
struct uart_8250_port uart = {};
210210
struct ingenic_uart_data *data;
211211
const struct ingenic_uart_config *cdata;
212-
const struct of_device_id *match;
213212
struct resource *regs;
214213
int irq, err, line;
215214

216-
match = of_match_device(of_match, &pdev->dev);
217-
if (!match) {
215+
cdata = of_device_get_match_data(&pdev->dev);
216+
if (!cdata) {
218217
dev_err(&pdev->dev, "Error: No device match found\n");
219218
return -ENODEV;
220219
}
221-
cdata = match->data;
222220

223221
irq = platform_get_irq(pdev, 0);
224222
if (irq < 0)

0 commit comments

Comments
 (0)