Skip to content

Commit f6a4e0e

Browse files
Tang Bindavem330
authored andcommitted
via-velocity: 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: Tang Bin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b708a96 commit f6a4e0e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/via/via-velocity.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,14 +2943,12 @@ static void velocity_pci_remove(struct pci_dev *pdev)
29432943

29442944
static int velocity_platform_probe(struct platform_device *pdev)
29452945
{
2946-
const struct of_device_id *of_id;
29472946
const struct velocity_info_tbl *info;
29482947
int irq;
29492948

2950-
of_id = of_match_device(velocity_of_ids, &pdev->dev);
2951-
if (!of_id)
2949+
info = of_device_get_match_data(&pdev->dev);
2950+
if (!info)
29522951
return -EINVAL;
2953-
info = of_id->data;
29542952

29552953
irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
29562954
if (!irq)

0 commit comments

Comments
 (0)