* [PATCH] memory: Make use of the helper function devm_platform_ioremap_resource()
@ 2022-04-18 2:01 cgel.zte
2022-04-19 14:10 ` Krzysztof Kozlowski
2022-04-19 14:59 ` Krzysztof Kozlowski
0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2022-04-18 2:01 UTC (permalink / raw)
To: krzysztof.kozlowski; +Cc: linux-kernel, Lv Ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.Make the
code simpler without functional changes.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
drivers/memory/fsl-corenet-cf.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/memory/fsl-corenet-cf.c b/drivers/memory/fsl-corenet-cf.c
index f8ea592c9cb5..7fc9f57ae278 100644
--- a/drivers/memory/fsl-corenet-cf.c
+++ b/drivers/memory/fsl-corenet-cf.c
@@ -172,7 +172,6 @@ static irqreturn_t ccf_irq(int irq, void *dev_id)
static int ccf_probe(struct platform_device *pdev)
{
struct ccf_private *ccf;
- struct resource *r;
const struct of_device_id *match;
u32 errinten;
int ret, irq;
@@ -185,13 +184,7 @@ static int ccf_probe(struct platform_device *pdev)
if (!ccf)
return -ENOMEM;
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!r) {
- dev_err(&pdev->dev, "%s: no mem resource\n", __func__);
- return -ENXIO;
- }
-
- ccf->regs = devm_ioremap_resource(&pdev->dev, r);
+ ccf->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(ccf->regs))
return PTR_ERR(ccf->regs);
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memory: Make use of the helper function devm_platform_ioremap_resource()
2022-04-18 2:01 [PATCH] memory: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
@ 2022-04-19 14:10 ` Krzysztof Kozlowski
2022-04-19 14:59 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-19 14:10 UTC (permalink / raw)
To: cgel.zte; +Cc: linux-kernel, Lv Ruyi, Zeal Robot
On 18/04/2022 04:01, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> Use the devm_platform_ioremap_resource() helper instead of calling
> platform_get_resource() and devm_ioremap_resource() separately.Make the
> code simpler without functional changes.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
This is for public bug reports. Don't use it for regular code which is
not related to any bug.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memory: Make use of the helper function devm_platform_ioremap_resource()
2022-04-18 2:01 [PATCH] memory: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
2022-04-19 14:10 ` Krzysztof Kozlowski
@ 2022-04-19 14:59 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-19 14:59 UTC (permalink / raw)
To: cgel.zte; +Cc: Krzysztof Kozlowski, Lv Ruyi, linux-kernel, Zeal Robot
On Mon, 18 Apr 2022 02:01:47 +0000, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> Use the devm_platform_ioremap_resource() helper instead of calling
> platform_get_resource() and devm_ioremap_resource() separately.Make the
> code simpler without functional changes.
>
>
> [...]
Applied, thanks!
[1/1] memory: Make use of the helper function devm_platform_ioremap_resource()
commit: d37b07897e5024088b2170b8e6e1c68d567b9be6
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-19 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 2:01 [PATCH] memory: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
2022-04-19 14:10 ` Krzysztof Kozlowski
2022-04-19 14: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
all inboxes | Powered by JetHome®