summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTang Bin <tangbin@cmss.chinamobile.com>2024-09-10 10:11:04 +0800
committerMark Brown <broonie@kernel.org>2024-09-10 12:40:25 +0100
commit5e6f78cb5f53c52a11090657e917d2d7202aea23 (patch)
treecc3a32fd80f63eb9ce2855da753f53ad4b90d388 /sound
parent86a7f453e99c3c202ac1623557e4f57bd73fc88c (diff)
downloadlwn-5e6f78cb5f53c52a11090657e917d2d7202aea23.tar.gz
lwn-5e6f78cb5f53c52a11090657e917d2d7202aea23.zip
ASoC: loongson: Add the correct judgement return
Use the function dev_err_probe can simplify code, but the error return should not be deleted, that is unreasonable, thus fix it. Fixes: 3d2528d6c021 ("ASoC: loongson: Simplify with dev_err_probe()") Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Link: https://patch.msgid.link/20240910021104.3400-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/loongson/loongson_card.c6
-rw-r--r--sound/soc/loongson/loongson_i2s_pci.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/loongson/loongson_card.c b/sound/soc/loongson/loongson_card.c
index 6078cdf09c22..7379f24d385c 100644
--- a/sound/soc/loongson/loongson_card.c
+++ b/sound/soc/loongson/loongson_card.c
@@ -184,16 +184,16 @@ static int loongson_asoc_card_probe(struct platform_device *pdev)
ret = device_property_read_string(dev, "model", &card->name);
if (ret)
- dev_err_probe(dev, ret, "Error parsing card name\n");
+ return dev_err_probe(dev, ret, "Error parsing card name\n");
ret = device_property_read_u32(dev, "mclk-fs", &ls_priv->mclk_fs);
if (ret)
- dev_err_probe(dev, ret, "Error parsing mclk-fs\n");
+ return dev_err_probe(dev, ret, "Error parsing mclk-fs\n");
ret = has_acpi_companion(dev) ? loongson_card_parse_acpi(ls_priv)
: loongson_card_parse_of(ls_priv);
if (ret)
- dev_err_probe(dev, ret, "Error parsing acpi/of properties\n");
+ return dev_err_probe(dev, ret, "Error parsing acpi/of properties\n");
return devm_snd_soc_register_card(dev, card);
}
diff --git a/sound/soc/loongson/loongson_i2s_pci.c b/sound/soc/loongson/loongson_i2s_pci.c
index 3872b1d8fce0..d2d0e5d8cac9 100644
--- a/sound/soc/loongson/loongson_i2s_pci.c
+++ b/sound/soc/loongson/loongson_i2s_pci.c
@@ -102,7 +102,7 @@ static int loongson_i2s_pci_probe(struct pci_dev *pdev,
i2s->regmap = devm_regmap_init_mmio(dev, i2s->reg_base,
&loongson_i2s_regmap_config);
if (IS_ERR(i2s->regmap))
- dev_err_probe(dev, PTR_ERR(i2s->regmap), "regmap_init_mmio failed\n");
+ return dev_err_probe(dev, PTR_ERR(i2s->regmap), "regmap_init_mmio failed\n");
tx_data = &i2s->tx_dma_data;
rx_data = &i2s->rx_dma_data;
@@ -115,15 +115,15 @@ static int loongson_i2s_pci_probe(struct pci_dev *pdev,
tx_data->irq = fwnode_irq_get_byname(fwnode, "tx");
if (tx_data->irq < 0)
- dev_err_probe(dev, tx_data->irq, "dma tx irq invalid\n");
+ return dev_err_probe(dev, tx_data->irq, "dma tx irq invalid\n");
rx_data->irq = fwnode_irq_get_byname(fwnode, "rx");
if (rx_data->irq < 0)
- dev_err_probe(dev, rx_data->irq, "dma rx irq invalid\n");
+ return dev_err_probe(dev, rx_data->irq, "dma rx irq invalid\n");
ret = device_property_read_u32(dev, "clock-frequency", &i2s->clk_rate);
if (ret)
- dev_err_probe(dev, ret, "clock-frequency property invalid\n");
+ return dev_err_probe(dev, ret, "clock-frequency property invalid\n");
dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
@@ -135,7 +135,7 @@ static int loongson_i2s_pci_probe(struct pci_dev *pdev,
ret = devm_snd_soc_register_component(dev, &loongson_i2s_component,
&loongson_i2s_dai, 1);
if (ret)
- dev_err_probe(dev, ret, "register DAI failed\n");
+ return dev_err_probe(dev, ret, "register DAI failed\n");
return 0;
}