Skip to contentSkip to conversation

ASoC: sgtl5000: Use i2c_get_clientdata()

PATCH Applied Fabio Estevam 2 participants 3 messages Jun 10, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: sgtl5000: Use i2c_get_clientdata()

We should use i2c_get_clientdata() to get the codec private structure.

---
 sound/soc/codecs/sgtl5000.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
sound/soc/codecs/sgtl5000.c +1 -5
index 2e0227b..d441559 100644
@@ -1571,11 +1571,7 @@ disable_clk:
 
 static int sgtl5000_i2c_remove(struct i2c_client *client)
 {
-	struct sgtl5000_priv *sgtl5000;
-	sgtl5000 = devm_kzalloc(&client->dev, sizeof(struct sgtl5000_priv),
-								GFP_KERNEL);
-	if (!sgtl5000)
-		return -ENOMEM;
+	struct sgtl5000_priv *sgtl5000 = i2c_get_clientdata(client);
 
 	snd_soc_unregister_codec(&client->dev);
 	clk_disable_unprepare(sgtl5000->mclk);
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/2 Documentation: sgtl5000.txt: Add 'clocks' entry as a required propery

Since commit 9e13f345 (ASoC: sgtl5000: Let the codec acquire its clock) , the 'clocks' entry is mandatory, so update the binding doc.

---
 Documentation/devicetree/bindings/sound/sgtl5000.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/sound/sgtl5000.txt +3 -0
index 9cc4444..955df60 100644
@@ -5,9 +5,12 @@ Required properties:
 
 - reg : the I2C address of the device
 
+- clocks : the clock provider of SYS_MCLK
+
 Example:
 
 codec: sgtl5000@0a {
 	compatible = "fsl,sgtl5000";
 	reg = <0x0a>;
+	clocks = <&clks 150>;
 };
Signature · 1 line
1.8.1.2