aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-29 11:13:32 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-02 08:42:42 -0500
commit7b46160000197209f7ebca8b92bdbb75795c473f (patch)
tree8655e2cacefc6fa10cfdd4b84a3c697bbbafdc6b /sound/pci/hda
parent0fcd9f4b3c60382205e5819c456aa9ea17b6f20f (diff)
ALSA: hwdep: Embed struct device
Like the previous patch, this one embeds the device object into hwdep object. For a proper object lifecycle, it's freed in the release callback. This also allows us to create sysfs entries via passing to the groups field of the device without explicit function calls. Since each driver can see the device and touch its groups field directly, we don't need to delegate in hwdep core any longer. So, remove the groups field from snd_hwdep, and let the user (in this case only hda_hwdep.c) modify the device groups. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_hwdep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 014a7849e8fd..11b5a42b4ec8 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -109,7 +109,6 @@ int snd_hda_create_hwdep(struct hda_codec *codec)
109 hwdep->iface = SNDRV_HWDEP_IFACE_HDA; 109 hwdep->iface = SNDRV_HWDEP_IFACE_HDA;
110 hwdep->private_data = codec; 110 hwdep->private_data = codec;
111 hwdep->exclusive = 1; 111 hwdep->exclusive = 1;
112 hwdep->groups = snd_hda_dev_attr_groups;
113 112
114 hwdep->ops.open = hda_hwdep_open; 113 hwdep->ops.open = hda_hwdep_open;
115 hwdep->ops.ioctl = hda_hwdep_ioctl; 114 hwdep->ops.ioctl = hda_hwdep_ioctl;
@@ -118,7 +117,11 @@ int snd_hda_create_hwdep(struct hda_codec *codec)
118#endif 117#endif
119 118
120 /* link to codec */ 119 /* link to codec */
121 hwdep->dev = &codec->dev; 120 hwdep->dev.parent = &codec->dev;
121
122 /* for sysfs */
123 hwdep->dev.groups = snd_hda_dev_attr_groups;
124 dev_set_drvdata(&hwdep->dev, codec);
122 125
123 return 0; 126 return 0;
124} 127}