Skip to content

Commit

Permalink
Revert "ALSA: hda: Add codec on bus address table lately"
Browse files Browse the repository at this point in the history
This reverts commit ee5f85d ("ALSA: hda: Add codec on bus address
table lately").  The commit caused several regression since I've
overlooked that the function doesn't manage only the caddr_tbl but
also the codec linked list that is referred indirectly in the other
drivers.

Revert for now to make everything back to work.

Fixes: ee5f85d ("ALSA: hda: Add codec on bus address table lately")
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
tiwai committed Aug 15, 2019
1 parent ddf7cb8 commit 246bb4a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions sound/hda/hdac_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus,
pm_runtime_get_noresume(&codec->dev);
atomic_set(&codec->in_pm, 0);

err = snd_hdac_bus_add_device(bus, codec);
if (err < 0)
goto error;

/* fill parameters */
codec->vendor_id = snd_hdac_read_parm(codec, AC_NODE_ROOT,
AC_PAR_VENDOR_ID);
Expand Down Expand Up @@ -139,22 +143,15 @@ int snd_hdac_device_register(struct hdac_device *codec)
err = device_add(&codec->dev);
if (err < 0)
return err;
err = snd_hdac_bus_add_device(codec->bus, codec);
if (err < 0)
goto error;
mutex_lock(&codec->widget_lock);
err = hda_widget_sysfs_init(codec);
mutex_unlock(&codec->widget_lock);
if (err < 0)
goto error_remove;
if (err < 0) {
device_del(&codec->dev);
return err;
}

return 0;

error_remove:
snd_hdac_bus_remove_device(codec->bus, codec);
error:
device_del(&codec->dev);
return err;
}
EXPORT_SYMBOL_GPL(snd_hdac_device_register);

Expand All @@ -168,8 +165,8 @@ void snd_hdac_device_unregister(struct hdac_device *codec)
mutex_lock(&codec->widget_lock);
hda_widget_sysfs_exit(codec);
mutex_unlock(&codec->widget_lock);
snd_hdac_bus_remove_device(codec->bus, codec);
device_del(&codec->dev);
snd_hdac_bus_remove_device(codec->bus, codec);
}
}
EXPORT_SYMBOL_GPL(snd_hdac_device_unregister);
Expand Down

0 comments on commit 246bb4a

Please sign in to comment.