|
@@ -132,8 +132,10 @@ struct snd_card {
|
|
int shutdown; /* this card is going down */
|
|
int shutdown; /* this card is going down */
|
|
int free_on_last_close; /* free in context of file_release */
|
|
int free_on_last_close; /* free in context of file_release */
|
|
wait_queue_head_t shutdown_sleep;
|
|
wait_queue_head_t shutdown_sleep;
|
|
- struct device *parent;
|
|
|
|
- struct device *dev;
|
|
|
|
|
|
+ struct device *dev; /* device assigned to this card */
|
|
|
|
+#ifndef CONFIG_SYSFS_DEPRECATED
|
|
|
|
+ struct device *card_dev; /* cardX object for sysfs */
|
|
|
|
+#endif
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
#ifdef CONFIG_PM
|
|
unsigned int power_state; /* power state */
|
|
unsigned int power_state; /* power state */
|
|
@@ -191,6 +193,16 @@ struct snd_minor {
|
|
struct device *dev; /* device for sysfs */
|
|
struct device *dev; /* device for sysfs */
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/* 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 */
|
|
/* sound.c */
|
|
|
|
|
|
extern int snd_major;
|
|
extern int snd_major;
|
|
@@ -257,7 +269,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file);
|
|
int snd_card_file_remove(struct snd_card *card, struct file *file);
|
|
int snd_card_file_remove(struct snd_card *card, struct file *file);
|
|
|
|
|
|
#ifndef snd_card_set_dev
|
|
#ifndef snd_card_set_dev
|
|
-#define snd_card_set_dev(card,devptr) ((card)->parent = (devptr))
|
|
|
|
|
|
+#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* device.c */
|
|
/* device.c */
|