summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 13:00:58 +0400
committerTakashi Iwai <tiwai@suse.de>2014-02-25 15:12:50 +0400
commitf806bdb2f7235907fcd310e6d147b3bcd281fa97 (patch)
treee0ec1378953e1cc742ca6c67d9fa8f69500f55b0 /sound/core
parentcaa751bad444268d756b48ca03d7cceda3430cc8 (diff)
downloadlinux-f806bdb2f7235907fcd310e6d147b3bcd281fa97.tar.xz
ALSA: hwdep: Take private_data as drvdata for sysfs
For referring to a different object from sysfs ops, take hwdep private_data as stored via dev_set_drvdata() at creating the device object. In that way, the same sysfs ops can be used by different device types. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/hwdep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 99f7e8515ba1..825cd2847940 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -441,6 +441,8 @@ static int snd_hwdep_dev_register(struct snd_device *device)
struct device *d = snd_get_device(SNDRV_DEVICE_TYPE_HWDEP,
hwdep->card, hwdep->device);
if (d) {
+ if (hwdep->private_data)
+ dev_set_drvdata(d, hwdep->private_data);
err = sysfs_create_groups(&d->kobj, hwdep->groups);
if (err < 0)
dev_warn(card->dev,