diff --git a/drivers/gpio/gpio-creg-snps.c b/drivers/gpio/gpio-creg-snps.c index f8ea961fa1de..157ab90f5ba8 100644 --- a/drivers/gpio/gpio-creg-snps.c +++ b/drivers/gpio/gpio-creg-snps.c @@ -134,7 +134,6 @@ static const struct of_device_id creg_gpio_ids[] = { static int creg_gpio_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; struct creg_gpio *hcg; u32 ngpios; @@ -148,8 +147,7 @@ static int creg_gpio_probe(struct platform_device *pdev) if (IS_ERR(hcg->regs)) return PTR_ERR(hcg->regs); - match = of_match_node(creg_gpio_ids, pdev->dev.of_node); - hcg->layout = match->data; + hcg->layout = device_get_match_data(dev); if (!hcg->layout) return -EINVAL;