summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_tegra.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-05-05 14:56:21 +0200
committerTakashi Iwai <tiwai@suse.de>2015-05-18 10:03:25 +0200
commit6a464a4ccb674a61eeec296bcc9b999b9252247f (patch)
tree73c8276ee6b593dd711a42f073fe486e699422eb /sound/pci/hda/hda_tegra.c
parentALSA: hda/hdmi - Implement Tegra-specific patch (diff)
downloadlinux-6a464a4ccb674a61eeec296bcc9b999b9252247f.tar.xz
linux-6a464a4ccb674a61eeec296bcc9b999b9252247f.zip
ALSA: hda/tegra - Improve error reporting
When probing, provide accurate error messages to help with debugging failures. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_tegra.c')
-rw-r--r--sound/pci/hda/hda_tegra.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index 7003677f7473..477742cb70a2 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -316,14 +316,20 @@ static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev)
int err;
hda->hda_clk = devm_clk_get(dev, "hda");
- if (IS_ERR(hda->hda_clk))
+ if (IS_ERR(hda->hda_clk)) {
+ dev_err(dev, "failed to get hda clock\n");
return PTR_ERR(hda->hda_clk);
+ }
hda->hda2codec_2x_clk = devm_clk_get(dev, "hda2codec_2x");
- if (IS_ERR(hda->hda2codec_2x_clk))
+ if (IS_ERR(hda->hda2codec_2x_clk)) {
+ dev_err(dev, "failed to get hda2codec_2x clock\n");
return PTR_ERR(hda->hda2codec_2x_clk);
+ }
hda->hda2hdmi_clk = devm_clk_get(dev, "hda2hdmi");
- if (IS_ERR(hda->hda2hdmi_clk))
+ if (IS_ERR(hda->hda2hdmi_clk)) {
+ dev_err(dev, "failed to get hda2hdmi clock\n");
return PTR_ERR(hda->hda2hdmi_clk);
+ }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hda->regs = devm_ioremap_resource(dev, res);
@@ -334,8 +340,10 @@ static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev)
bus->addr = res->start + HDA_BAR0;
err = hda_tegra_enable_clocks(hda);
- if (err)
+ if (err) {
+ dev_err(dev, "failed to get enable clocks\n");
return err;
+ }
hda_tegra_init(hda);
@@ -385,12 +393,17 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
/* initialize streams */
err = azx_init_streams(chip);
- if (err < 0)
+ if (err < 0) {
+ dev_err(card->dev, "failed to initialize streams: %d\n", err);
return err;
+ }
err = azx_alloc_stream_pages(chip);
- if (err < 0)
+ if (err < 0) {
+ dev_err(card->dev, "failed to allocate stream pages: %d\n",
+ err);
return err;
+ }
/* initialize chip */
azx_init_chip(chip, 1);