In this function, devm_platform_ioremap_resource() should be suitable[...]
to simplify code.
Signed-off-by: Tang Bin <tangbin@xxxxxxxxxxxxxxxxxxxx>
---
drivers/ata/ahci_xgene.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 16246c843..061209275 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
/* Retrieve the optional IP mux resource */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
- if (res) {
- void __iomem *csr = devm_ioremap_resource(dev, res);
- if (IS_ERR(csr))
- return PTR_ERR(csr);
-
- ctx->csr_mux = csr;
- }
+ ctx->csr_mux = devm_platform_ioremap_resource(pdev, 4);
+ if (IS_ERR(ctx->csr_mux))
+ return PTR_ERR(ctx->csr_mux);