diff options
Diffstat (limited to 'drivers/ata/ahci_xgene.c')
-rw-r--r-- | drivers/ata/ahci_xgene.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index f03aab187f4d..0f8538f238b6 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c | |||
@@ -434,7 +434,7 @@ static int xgene_ahci_mux_select(struct xgene_ahci_context *ctx) | |||
434 | u32 val; | 434 | u32 val; |
435 | 435 | ||
436 | /* Check for optional MUX resource */ | 436 | /* Check for optional MUX resource */ |
437 | if (IS_ERR(ctx->csr_mux)) | 437 | if (!ctx->csr_mux) |
438 | return 0; | 438 | return 0; |
439 | 439 | ||
440 | val = readl(ctx->csr_mux + SATA_ENET_CONFIG_REG); | 440 | val = readl(ctx->csr_mux + SATA_ENET_CONFIG_REG); |
@@ -484,7 +484,13 @@ static int xgene_ahci_probe(struct platform_device *pdev) | |||
484 | 484 | ||
485 | /* Retrieve the optional IP mux resource */ | 485 | /* Retrieve the optional IP mux resource */ |
486 | res = platform_get_resource(pdev, IORESOURCE_MEM, 4); | 486 | res = platform_get_resource(pdev, IORESOURCE_MEM, 4); |
487 | ctx->csr_mux = devm_ioremap_resource(dev, res); | 487 | if (res) { |
488 | void __iomem *csr = devm_ioremap_resource(dev, res); | ||
489 | if (IS_ERR(csr)) | ||
490 | return PTR_ERR(csr); | ||
491 | |||
492 | ctx->csr_mux = csr; | ||
493 | } | ||
488 | 494 | ||
489 | dev_dbg(dev, "VAddr 0x%p Mmio VAddr 0x%p\n", ctx->csr_core, | 495 | dev_dbg(dev, "VAddr 0x%p Mmio VAddr 0x%p\n", ctx->csr_core, |
490 | hpriv->mmio); | 496 | hpriv->mmio); |