Skip to content

Commit

Permalink
serial: 8250_ingenic: Use of_device_get_match_data
Browse files Browse the repository at this point in the history
Retrieve OF match data, it's better and cleaner to use
'of_device_get_match_data' over 'of_match_device'.

Acked-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210822032806.3256-2-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tang Bin authored and Greg Kroah-Hartman committed Aug 26, 2021
1 parent fa934fc commit 618bf2b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/tty/serial/8250/8250_ingenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,14 @@ static int ingenic_uart_probe(struct platform_device *pdev)
struct uart_8250_port uart = {};
struct ingenic_uart_data *data;
const struct ingenic_uart_config *cdata;
const struct of_device_id *match;
struct resource *regs;
int irq, err, line;

match = of_match_device(of_match, &pdev->dev);
if (!match) {
cdata = of_device_get_match_data(&pdev->dev);
if (!cdata) {
dev_err(&pdev->dev, "Error: No device match found\n");
return -ENODEV;
}
cdata = match->data;

irq = platform_get_irq(pdev, 0);
if (irq < 0)
Expand Down

0 comments on commit 618bf2b

Please sign in to comment.