Skip to content

Commit 14a3fd0

Browse files
Philipp Stannerbroonie
authored andcommitted
ASoC: intel: atom: Return -ENOMEM if pcim_iomap() fails
The error checks for pcim_iomap() have the function return -EINVAL. -ENOMEM is a more appropriate error code. Replace -EINVAL with -ENOMEM. Signed-off-by: Philipp Stanner <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 938cabc commit 14a3fd0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sound/soc/intel/atom/sst/sst_pci.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
4949

5050
ctx->ddr = pcim_iomap(pci, 0, 0);
5151
if (!ctx->ddr)
52-
return -EINVAL;
52+
return -ENOMEM;
5353

5454
dev_dbg(ctx->dev, "sst: DDR Ptr %p\n", ctx->ddr);
5555
} else {
@@ -59,15 +59,15 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
5959
ctx->shim_phy_add = pci_resource_start(pci, 1);
6060
ctx->shim = pcim_iomap(pci, 1, 0);
6161
if (!ctx->shim)
62-
return -EINVAL;
62+
return -ENOMEM;
6363

6464
dev_dbg(ctx->dev, "SST Shim Ptr %p\n", ctx->shim);
6565

6666
/* Shared SRAM */
6767
ctx->mailbox_add = pci_resource_start(pci, 2);
6868
ctx->mailbox = pcim_iomap(pci, 2, 0);
6969
if (!ctx->mailbox)
70-
return -EINVAL;
70+
return -ENOMEM;
7171

7272
dev_dbg(ctx->dev, "SRAM Ptr %p\n", ctx->mailbox);
7373

@@ -76,7 +76,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
7676
ctx->iram_base = pci_resource_start(pci, 3);
7777
ctx->iram = pcim_iomap(pci, 3, 0);
7878
if (!ctx->iram)
79-
return -EINVAL;
79+
return -ENOMEM;
8080

8181
dev_dbg(ctx->dev, "IRAM Ptr %p\n", ctx->iram);
8282

@@ -85,7 +85,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
8585
ctx->dram_base = pci_resource_start(pci, 4);
8686
ctx->dram = pcim_iomap(pci, 4, 0);
8787
if (!ctx->dram)
88-
return -EINVAL;
88+
return -ENOMEM;
8989

9090
dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
9191
return 0;

0 commit comments

Comments
 (0)