From f806bdb2f7235907fcd310e6d147b3bcd281fa97 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 25 Feb 2014 10:00:58 +0100 Subject: 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 --- sound/core/hwdep.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/core/hwdep.c') diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 99f7e85..825cd28 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, -- cgit v1.1