summaryrefslogtreecommitdiffstats
path: root/kernel/sound/hda/hdac_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sound/hda/hdac_sysfs.c')
-rw-r--r--kernel/sound/hda/hdac_sysfs.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/sound/hda/hdac_sysfs.c b/kernel/sound/hda/hdac_sysfs.c
index 0a6ce3b84..42d61bf41 100644
--- a/kernel/sound/hda/hdac_sysfs.c
+++ b/kernel/sound/hda/hdac_sysfs.c
@@ -45,6 +45,13 @@ CODEC_ATTR(mfg);
CODEC_ATTR_STR(vendor_name);
CODEC_ATTR_STR(chip_name);
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ return snd_hdac_codec_modalias(dev_to_hdac_dev(dev), buf, 256);
+}
+static DEVICE_ATTR_RO(modalias);
+
static struct attribute *hdac_dev_attrs[] = {
&dev_attr_type.attr,
&dev_attr_vendor_id.attr,
@@ -54,6 +61,7 @@ static struct attribute *hdac_dev_attrs[] = {
&dev_attr_mfg.attr,
&dev_attr_vendor_name.attr,
&dev_attr_chip_name.attr,
+ &dev_attr_modalias.attr,
NULL
};
@@ -321,8 +329,7 @@ static void widget_tree_free(struct hdac_device *codec)
free_widget_node(*p, &widget_node_group);
kfree(tree->nodes);
}
- if (tree->root)
- kobject_put(tree->root);
+ kobject_put(tree->root);
kfree(tree);
codec->widgets = NULL;
}
@@ -391,6 +398,9 @@ int hda_widget_sysfs_init(struct hdac_device *codec)
{
int err;
+ if (codec->widgets)
+ return 0; /* already created */
+
err = widget_tree_create(codec);
if (err < 0) {
widget_tree_free(codec);