Skip to content

Commit

Permalink
ahci_xgene: Fix the error print invalid resource for APM X-Gene SoC A…
Browse files Browse the repository at this point in the history
…HCI 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>
  • Loading branch information
Suman Tripathi authored and Tejun Heo committed Sep 23, 2014
1 parent d7bead1 commit a77b6ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/ata/ahci_xgene.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static int xgene_ahci_mux_select(struct xgene_ahci_context *ctx)
u32 val;

/* Check for optional MUX resource */
if (IS_ERR(ctx->csr_mux))
if (!ctx->csr_mux)
return 0;

val = readl(ctx->csr_mux + SATA_ENET_CONFIG_REG);
Expand Down Expand Up @@ -456,7 +456,13 @@ static int xgene_ahci_probe(struct platform_device *pdev)

/* Retrieve the optional IP mux resource */
res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
ctx->csr_mux = devm_ioremap_resource(dev, res);
if (res) {
void __iomem *csr = devm_ioremap_resource(dev, res);
if (IS_ERR(csr))
return PTR_ERR(csr);

ctx->csr_mux = csr;
}

dev_dbg(dev, "VAddr 0x%p Mmio VAddr 0x%p\n", ctx->csr_core,
hpriv->mmio);
Expand Down

0 comments on commit a77b6ee

Please sign in to comment.