Commit b708a96d authored by Tang Bin's avatar Tang Bin Committed by David S. Miller

via-rhine: Use of_device_get_match_data to simplify code

Retrieve OF match data, it's better and cleaner to use
'of_device_get_match_data' over 'of_match_device'.
Signed-off-by: default avatarTang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 609c1308
...@@ -1113,13 +1113,12 @@ static int rhine_init_one_pci(struct pci_dev *pdev, ...@@ -1113,13 +1113,12 @@ static int rhine_init_one_pci(struct pci_dev *pdev,
static int rhine_init_one_platform(struct platform_device *pdev) static int rhine_init_one_platform(struct platform_device *pdev)
{ {
const struct of_device_id *match;
const u32 *quirks; const u32 *quirks;
int irq; int irq;
void __iomem *ioaddr; void __iomem *ioaddr;
match = of_match_device(rhine_of_tbl, &pdev->dev); quirks = of_device_get_match_data(&pdev->dev);
if (!match) if (!quirks)
return -EINVAL; return -EINVAL;
ioaddr = devm_platform_ioremap_resource(pdev, 0); ioaddr = devm_platform_ioremap_resource(pdev, 0);
...@@ -1130,10 +1129,6 @@ static int rhine_init_one_platform(struct platform_device *pdev) ...@@ -1130,10 +1129,6 @@ static int rhine_init_one_platform(struct platform_device *pdev)
if (!irq) if (!irq)
return -EINVAL; return -EINVAL;
quirks = match->data;
if (!quirks)
return -EINVAL;
return rhine_init_one_common(&pdev->dev, *quirks, return rhine_init_one_common(&pdev->dev, *quirks,
(long)ioaddr, ioaddr, irq); (long)ioaddr, ioaddr, irq);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment