aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-11-03 09:31:56 +0100
committerTakashi Iwai <tiwai@suse.de>2010-11-03 09:31:56 +0100
commit81c67476d6450389914c084d66fb193ef78c5597 (patch)
treef22ed1705b16ed5e406ab2b9097c6cea6380d9ef
parent9e6ae7ce14e2be710021829810f459e4aaa99d08 (diff)
downloadalsa-driver-build-unstable-81c67476d6450389914c084d66fb193ef78c5597.tar.gz
Add CONFIG_SYSFS_DEPRECATED hack for older kernels
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--acore/init.patch62
-rw-r--r--include/sound/core.patch26
2 files changed, 77 insertions, 11 deletions
diff --git a/acore/init.patch b/acore/init.patch
index b53084dfc..b9bc9cf6e 100644
--- a/acore/init.patch
+++ b/acore/init.patch
@@ -1,5 +1,5 @@
--- ../alsa-kernel/core/init.c 2010-11-02 16:17:52.267995721 +0100
-+++ init.c 2010-11-02 16:47:32.709413929 +0100
++++ init.c 2010-11-03 09:30:44.003861335 +0100
@@ -1,3 +1,5 @@
+#define __NO_VERSION__
+#include "adriver.h"
@@ -49,9 +49,41 @@
.mmap = snd_disconnect_mmap,
.fasync = snd_disconnect_fasync
};
-@@ -652,9 +668,21 @@ int snd_card_register(struct snd_card *c
- return -EINVAL;
+@@ -395,10 +411,12 @@ int snd_card_disconnect(struct snd_card
+ snd_printk(KERN_ERR "not all devices for card %i can be disconnected\n", card->number);
+
+ snd_info_card_disconnect(card);
++#ifndef CONFIG_SYSFS_DEPRECATED
+ if (card->card_dev) {
+ device_unregister(card->card_dev);
+ card->card_dev = NULL;
+ }
++#endif
+ #ifdef CONFIG_PM
+ wake_up(&card->power_sleep);
+ #endif
+@@ -571,6 +589,7 @@ void snd_card_set_id(struct snd_card *ca
+ }
+ EXPORT_SYMBOL(snd_card_set_id);
+
++#ifndef CONFIG_SYSFS_DEPRECATED
+ static ssize_t
+ card_id_show_attr(struct device *dev,
+ struct device_attribute *attr, char *buf)
+@@ -632,6 +651,7 @@ card_number_show_attr(struct device *dev
+
+ static struct device_attribute card_number_attrs =
+ __ATTR(number, S_IRUGO, card_number_show_attr, NULL);
++#endif /* CONFIG_SYSFS_DEPRECATED */
+ /**
+ * snd_card_register - register the soundcard
+@@ -650,15 +670,27 @@ int snd_card_register(struct snd_card *c
+
+ if (snd_BUG_ON(!card))
+ return -EINVAL;
+-
++#ifndef CONFIG_SYSFS_DEPRECATED
if (!card->card_dev) {
+#ifdef CONFIG_SND_HAS_DEVICE_CREATE_DRVDATA
+ card->card_dev = device_create_drvdata(sound_class, card->dev,
@@ -71,7 +103,29 @@
if (IS_ERR(card->card_dev))
card->card_dev = NULL;
}
-@@ -945,3 +973,16 @@ int snd_power_wait(struct snd_card *card
+-
++#endif
+ if ((err = snd_device_register_all(card)) < 0)
+ return err;
+ mutex_lock(&snd_card_mutex);
+@@ -675,6 +707,7 @@ int snd_card_register(struct snd_card *c
+ if (snd_mixer_oss_notify_callback)
+ snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER);
+ #endif
++#ifndef CONFIG_SYSFS_DEPRECATED
+ if (card->card_dev) {
+ err = device_create_file(card->card_dev, &card_id_attrs);
+ if (err < 0)
+@@ -683,7 +716,7 @@ int snd_card_register(struct snd_card *c
+ if (err < 0)
+ return err;
+ }
+-
++#endif
+ return 0;
+ }
+
+@@ -945,3 +978,16 @@ int snd_power_wait(struct snd_card *card
EXPORT_SYMBOL(snd_power_wait);
#endif /* CONFIG_PM */
diff --git a/include/sound/core.patch b/include/sound/core.patch
index a245fc1f6..874fb2fc5 100644
--- a/include/sound/core.patch
+++ b/include/sound/core.patch
@@ -1,6 +1,6 @@
---- ../../alsa-kernel/include/core.h 2009-09-07 15:59:08.000000000 +0200
-+++ core.h 2009-09-07 16:01:27.000000000 +0200
-@@ -104,8 +104,12 @@
+--- ../../alsa-kernel/include/core.h 2010-11-02 16:17:51.796016548 +0100
++++ core.h 2010-11-03 09:27:19.656922316 +0100
+@@ -104,8 +104,12 @@ struct snd_card {
char shortname[32]; /* short name of this soundcard */
char longname[80]; /* name of this soundcard */
char mixername[80]; /* mixer name */
@@ -13,7 +13,7 @@
struct module *module; /* top-level module */
void *private_data; /* private data for soundcard */
-@@ -125,7 +129,11 @@
+@@ -125,7 +129,11 @@ struct snd_card {
struct snd_info_entry *proc_id; /* the card id */
struct proc_dir_entry *proc_root_link; /* number link to real id */
@@ -25,7 +25,7 @@
struct snd_shutdown_f_ops *s_f_ops; /* file operations in the shutdown
state */
spinlock_t files_lock; /* lock the files for this card */
-@@ -147,6 +155,15 @@
+@@ -145,6 +153,15 @@ struct snd_card {
struct snd_mixer_oss *mixer_oss;
int mixer_oss_change_count;
#endif
@@ -41,7 +41,19 @@
};
#ifdef CONFIG_PM
-@@ -302,7 +319,11 @@
+@@ -194,7 +211,11 @@ struct snd_minor {
+ /* return a device pointer linked to each sound device as a parent */
+ static inline struct device *snd_card_get_device_link(struct snd_card *card)
+ {
++#ifdef CONFIG_SYSFS_DEPRECATED
++ return card ? card->dev : NULL;
++#else
+ return card ? card->card_dev : NULL;
++#endif
+ }
+
+ /* sound.c */
+@@ -296,7 +317,11 @@ int snd_component_add(struct snd_card *c
int snd_card_file_add(struct snd_card *card, struct file *file);
int snd_card_file_remove(struct snd_card *card, struct file *file);
@@ -53,7 +65,7 @@
/* device.c */
-@@ -417,12 +438,20 @@
+@@ -411,12 +436,20 @@ static inline int __snd_bug_on(int cond)
/* for easier backward-porting */
#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)