Skip to content

Commit

Permalink
ALSA: hda/tas2781: move set_drv_data outside tasdevice_init
Browse files Browse the repository at this point in the history
commit e7aa105 upstream.

allow driver specific driver data in tas2781-hda-i2c and tas2781-i2c

Fixes: ef3bcde ("ASoC: tas2781: Add tas2781 driver")
CC: stable@vger.kernel.org
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://lore.kernel.org/r/1398bd8bf3e935b1595a99128320e4a1913e210a.1703204848.git.soyer@irl.hu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
soyersoyer authored and gregkh committed Jan 10, 2024
1 parent aee67bb commit cb7a397
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sound/pci/hda/tas2781_hda_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ static int tas2781_hda_i2c_probe(struct i2c_client *clt)
if (!tas_priv)
return -ENOMEM;

dev_set_drvdata(&clt->dev, tas_priv);

tas_priv->irq_info.irq = clt->irq;
ret = tas2781_read_acpi(tas_priv, device_name);
if (ret)
Expand Down
2 changes: 0 additions & 2 deletions sound/soc/codecs/tas2781-comlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ int tasdevice_init(struct tasdevice_priv *tas_priv)
tas_priv->tasdevice[i].cur_conf = -1;
}

dev_set_drvdata(tas_priv->dev, tas_priv);

mutex_init(&tas_priv->codec_lock);

out:
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/tas2781-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,8 @@ static int tasdevice_i2c_probe(struct i2c_client *i2c)
if (!tas_priv)
return -ENOMEM;

dev_set_drvdata(&i2c->dev, tas_priv);

if (ACPI_HANDLE(&i2c->dev)) {
acpi_id = acpi_match_device(i2c->dev.driver->acpi_match_table,
&i2c->dev);
Expand Down

0 comments on commit cb7a397

Please sign in to comment.