linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] memory: ti-emif-pm: Use device_get_match_data() to simplify   the code
@ 2022-11-17 11:39 ye.xingchen
  2022-12-27  8:59 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: ye.xingchen @ 2022-11-17 11:39 UTC (permalink / raw)
  To: ssantosh; +Cc: krzysztof.kozlowski, linux-kernel

From: ye xingchen <ye.xingchen@zte.com.cn>

Directly get the match data with device_get_match_data().

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/memory/ti-emif-pm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/memory/ti-emif-pm.c b/drivers/memory/ti-emif-pm.c
index 31d6266f008c..cef0d3beb63b 100644
--- a/drivers/memory/ti-emif-pm.c
+++ b/drivers/memory/ti-emif-pm.c
@@ -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,
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-next] memory: ti-emif-pm: Use device_get_match_data() to simplify the code
  2022-11-17 11:39 [PATCH linux-next] memory: ti-emif-pm: Use device_get_match_data() to simplify the code ye.xingchen
@ 2022-12-27  8:59 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-27  8:59 UTC (permalink / raw)
  To: ye.xingchen, ssantosh; +Cc: Krzysztof Kozlowski, linux-kernel

On Thu, 17 Nov 2022 19:39:32 +0800 (CST), ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Directly get the match data with device_get_match_data().
> 
> 

Applied, thanks!

[1/1] memory: ti-emif-pm: Use device_get_match_data() to simplify the code
      https://git.kernel.org/krzk/linux-mem-ctrl/c/271c9a97dec87341bdaea685f3502a0ed0e4a1af

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-27  9:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 11:39 [PATCH linux-next] memory: ti-emif-pm: Use device_get_match_data() to simplify the code ye.xingchen
2022-12-27  8:59 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).