Skip to contentSkip to conversation

memory: ti-emif-pm: Use device_get_match_data() to simplify the code

PATCH Applied [email protected] 2 participants 2 messages Nov 17, 2022 – Dec 27, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: ti-emif-pm: Use device_get_match_data() to simplify the code

From: ye xingchen <[email protected]>

Directly get the match data with device_get_match_data().

---
 drivers/memory/ti-emif-pm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/memory/ti-emif-pm.c +1 -6
index 31d6266f008c..cef0d3beb63b 100644
@@ -277,18 +277,13 @@ static int ti_emif_probe(struct platform_device *pdev)
 	int ret;
 	struct resource *res;
 	struct device *dev = &pdev->dev;
-	const struct of_device_id *match;
 	struct ti_emif_data *emif_data;
 
 	emif_data = devm_kzalloc(dev, sizeof(*emif_data), GFP_KERNEL);
 	if (!emif_data)
 		return -ENOMEM;
 
-	match = of_match_device(ti_emif_of_match, &pdev->dev);
-	if (!match)
-		return -ENODEV;
-
-	emif_data->pm_data.ti_emif_sram_config = (unsigned long)match->data;
+	emif_data->pm_data.ti_emif_sram_config = (unsigned long) device_get_match_data(&pdev->dev);
 
 	emif_data->pm_data.ti_emif_base_addr_virt = devm_platform_get_and_ioremap_resource(pdev,
 											   0,
Signature · 1 line
2.25.1