diff options
Diffstat (limited to 'sound/soc/fsl/imx-sgtl5000.c')
-rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index 46c5b4fdfc52..ca1be1d9dcf0 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c | |||
@@ -62,7 +62,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
62 | struct device_node *ssi_np, *codec_np; | 62 | struct device_node *ssi_np, *codec_np; |
63 | struct platform_device *ssi_pdev; | 63 | struct platform_device *ssi_pdev; |
64 | struct i2c_client *codec_dev; | 64 | struct i2c_client *codec_dev; |
65 | struct imx_sgtl5000_data *data; | 65 | struct imx_sgtl5000_data *data = NULL; |
66 | int int_port, ext_port; | 66 | int int_port, ext_port; |
67 | int ret; | 67 | int ret; |
68 | 68 | ||
@@ -128,7 +128,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
128 | goto fail; | 128 | goto fail; |
129 | } | 129 | } |
130 | 130 | ||
131 | data->codec_clk = devm_clk_get(&codec_dev->dev, NULL); | 131 | data->codec_clk = clk_get(&codec_dev->dev, NULL); |
132 | if (IS_ERR(data->codec_clk)) { | 132 | if (IS_ERR(data->codec_clk)) { |
133 | ret = PTR_ERR(data->codec_clk); | 133 | ret = PTR_ERR(data->codec_clk); |
134 | goto fail; | 134 | goto fail; |
@@ -172,6 +172,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
172 | return 0; | 172 | return 0; |
173 | 173 | ||
174 | fail: | 174 | fail: |
175 | if (data && !IS_ERR(data->codec_clk)) | ||
176 | clk_put(data->codec_clk); | ||
175 | if (ssi_np) | 177 | if (ssi_np) |
176 | of_node_put(ssi_np); | 178 | of_node_put(ssi_np); |
177 | if (codec_np) | 179 | if (codec_np) |
@@ -185,6 +187,7 @@ static int imx_sgtl5000_remove(struct platform_device *pdev) | |||
185 | struct imx_sgtl5000_data *data = platform_get_drvdata(pdev); | 187 | struct imx_sgtl5000_data *data = platform_get_drvdata(pdev); |
186 | 188 | ||
187 | snd_soc_unregister_card(&data->card); | 189 | snd_soc_unregister_card(&data->card); |
190 | clk_put(data->codec_clk); | ||
188 | 191 | ||
189 | return 0; | 192 | return 0; |
190 | } | 193 | } |