mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
ALSA: usb-audio: Drop CONFIG_PM ifdefs
Practically seen, CONFIG_PM is almost mandatory. Let's drop the ugly ifdef lines and simplify the code. Link: https://lore.kernel.org/r/20211202084053.18201-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
82cd3ba691
commit
86a9bb5bf9
@ -987,8 +987,6 @@ void snd_usb_unlock_shutdown(struct snd_usb_audio *chip)
|
|||||||
wake_up(&chip->shutdown_wait);
|
wake_up(&chip->shutdown_wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
|
|
||||||
int snd_usb_autoresume(struct snd_usb_audio *chip)
|
int snd_usb_autoresume(struct snd_usb_audio *chip)
|
||||||
{
|
{
|
||||||
int i, err;
|
int i, err;
|
||||||
@ -1100,11 +1098,6 @@ static int usb_audio_resume(struct usb_interface *intf)
|
|||||||
atomic_dec(&chip->active); /* allow autopm after this point */
|
atomic_dec(&chip->active); /* allow autopm after this point */
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define usb_audio_suspend NULL
|
|
||||||
#define usb_audio_resume NULL
|
|
||||||
#define usb_audio_resume NULL
|
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
|
|
||||||
static const struct usb_device_id usb_audio_ids [] = {
|
static const struct usb_device_id usb_audio_ids [] = {
|
||||||
#include "quirks-table.h"
|
#include "quirks-table.h"
|
||||||
|
@ -3629,7 +3629,6 @@ void snd_usb_mixer_disconnect(struct usb_mixer_interface *mixer)
|
|||||||
mixer->disconnected = true;
|
mixer->disconnected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
/* stop any bus activity of a mixer */
|
/* stop any bus activity of a mixer */
|
||||||
static void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer)
|
static void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer)
|
||||||
{
|
{
|
||||||
@ -3711,7 +3710,6 @@ int snd_usb_mixer_resume(struct usb_mixer_interface *mixer)
|
|||||||
|
|
||||||
return snd_usb_mixer_activate(mixer);
|
return snd_usb_mixer_activate(mixer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list,
|
void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list,
|
||||||
struct usb_mixer_interface *mixer,
|
struct usb_mixer_interface *mixer,
|
||||||
@ -3720,7 +3718,5 @@ void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list,
|
|||||||
list->mixer = mixer;
|
list->mixer = mixer;
|
||||||
list->id = unitid;
|
list->id = unitid;
|
||||||
list->dump = snd_usb_mixer_dump_cval;
|
list->dump = snd_usb_mixer_dump_cval;
|
||||||
#ifdef CONFIG_PM
|
|
||||||
list->resume = restore_mixer_value;
|
list->resume = restore_mixer_value;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -118,10 +118,8 @@ void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list,
|
|||||||
int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
|
int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
|
||||||
unsigned int size, unsigned int __user *_tlv);
|
unsigned int size, unsigned int __user *_tlv);
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
int snd_usb_mixer_suspend(struct usb_mixer_interface *mixer);
|
int snd_usb_mixer_suspend(struct usb_mixer_interface *mixer);
|
||||||
int snd_usb_mixer_resume(struct usb_mixer_interface *mixer);
|
int snd_usb_mixer_resume(struct usb_mixer_interface *mixer);
|
||||||
#endif
|
|
||||||
|
|
||||||
int snd_usb_set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel,
|
int snd_usb_set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel,
|
||||||
int index, int value);
|
int index, int value);
|
||||||
|
@ -3280,7 +3280,6 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
void snd_usb_mixer_resume_quirk(struct usb_mixer_interface *mixer)
|
void snd_usb_mixer_resume_quirk(struct usb_mixer_interface *mixer)
|
||||||
{
|
{
|
||||||
switch (mixer->chip->usb_id) {
|
switch (mixer->chip->usb_id) {
|
||||||
@ -3289,7 +3288,6 @@ void snd_usb_mixer_resume_quirk(struct usb_mixer_interface *mixer)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
|
void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
|
||||||
int unitid)
|
int unitid)
|
||||||
|
@ -14,9 +14,7 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
|
|||||||
struct usb_mixer_elem_info *cval, int unitid,
|
struct usb_mixer_elem_info *cval, int unitid,
|
||||||
struct snd_kcontrol *kctl);
|
struct snd_kcontrol *kctl);
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
void snd_usb_mixer_resume_quirk(struct usb_mixer_interface *mixer);
|
void snd_usb_mixer_resume_quirk(struct usb_mixer_interface *mixer);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SND_USB_MIXER_QUIRKS_H */
|
#endif /* SND_USB_MIXER_QUIRKS_H */
|
||||||
|
|
||||||
|
@ -21,17 +21,7 @@ struct snd_usb_power_domain *
|
|||||||
snd_usb_find_power_domain(struct usb_host_interface *ctrl_iface,
|
snd_usb_find_power_domain(struct usb_host_interface *ctrl_iface,
|
||||||
unsigned char id);
|
unsigned char id);
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
int snd_usb_autoresume(struct snd_usb_audio *chip);
|
int snd_usb_autoresume(struct snd_usb_audio *chip);
|
||||||
void snd_usb_autosuspend(struct snd_usb_audio *chip);
|
void snd_usb_autosuspend(struct snd_usb_audio *chip);
|
||||||
#else
|
|
||||||
static inline int snd_usb_autoresume(struct snd_usb_audio *chip)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static inline void snd_usb_autosuspend(struct snd_usb_audio *chip)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __USBAUDIO_POWER_H */
|
#endif /* __USBAUDIO_POWER_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user