提交 74d2fb7e 编写于 作者: T Tang Bin 提交者: Greg Kroah-Hartman

serial: vt8500: 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'.
Signed-off-by: NZhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: NTang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210822032806.3256-4-tangbin@cmss.chinamobile.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a6a65f9e
...@@ -623,17 +623,14 @@ static int vt8500_serial_probe(struct platform_device *pdev) ...@@ -623,17 +623,14 @@ static int vt8500_serial_probe(struct platform_device *pdev)
struct vt8500_port *vt8500_port; struct vt8500_port *vt8500_port;
struct resource *mmres, *irqres; struct resource *mmres, *irqres;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
const struct of_device_id *match;
const unsigned int *flags; const unsigned int *flags;
int ret; int ret;
int port; int port;
match = of_match_device(wmt_dt_ids, &pdev->dev); flags = of_device_get_match_data(&pdev->dev);
if (!match) if (!flags)
return -EINVAL; return -EINVAL;
flags = match->data;
mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0); mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0); irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!mmres || !irqres) if (!mmres || !irqres)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册