aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuman Tripathi <stripathi@apm.com>2014-09-22 09:01:33 -0400
committerTejun Heo <tj@kernel.org>2014-09-23 10:07:11 -0400
commita77b6ee90dfc3798bdcbdca7a9284d7e8c006af7 (patch)
treeda77300ea56e188deb20d6f2dc3262bdf5b7bd9e
parentd7bead1b8890c3e47a24db270fdb840ea728d8f0 (diff)
ahci_xgene: Fix the error print invalid resource for APM X-Gene SoC AHCI SATA Host Controller driver.
This patch fixes the error print invalid resource for the APM X-Gene SoC AHCI SATA Host Controller driver. This print was due to the fact that the controller 3 don't have a mux resource. This didn't result in any errors but the print seems like meaningless. Signed-off-by: Loc Ho <lho@apm.com> Signed-off-by: Suman Tripathi <stripathi@apm.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ata/ahci_xgene.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index bc281115490b..7822c8e7a948 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -406,7 +406,7 @@ static int xgene_ahci_mux_select(struct xgene_ahci_context *ctx)
406 u32 val; 406 u32 val;
407 407
408 /* Check for optional MUX resource */ 408 /* Check for optional MUX resource */
409 if (IS_ERR(ctx->csr_mux)) 409 if (!ctx->csr_mux)
410 return 0; 410 return 0;
411 411
412 val = readl(ctx->csr_mux + SATA_ENET_CONFIG_REG); 412 val = readl(ctx->csr_mux + SATA_ENET_CONFIG_REG);
@@ -456,7 +456,13 @@ static int xgene_ahci_probe(struct platform_device *pdev)
456 456
457 /* Retrieve the optional IP mux resource */ 457 /* Retrieve the optional IP mux resource */
458 res = platform_get_resource(pdev, IORESOURCE_MEM, 4); 458 res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
459 ctx->csr_mux = devm_ioremap_resource(dev, res); 459 if (res) {
460 void __iomem *csr = devm_ioremap_resource(dev, res);
461 if (IS_ERR(csr))
462 return PTR_ERR(csr);
463
464 ctx->csr_mux = csr;
465 }
460 466
461 dev_dbg(dev, "VAddr 0x%p Mmio VAddr 0x%p\n", ctx->csr_core, 467 dev_dbg(dev, "VAddr 0x%p Mmio VAddr 0x%p\n", ctx->csr_core,
462 hpriv->mmio); 468 hpriv->mmio);