mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-01 08:04:22 +08:00
ALSA: scarlett2: Minor refactor MSD mode check
Create local variable for storing private data pointer in snd_scarlett2_controls_create(). It's currently only used for checking msd_switch, but it will be used again. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/ab50939dca0fdc5fa3493fc8eee3a2fdefffa62d.1703612638.git.g@b4.vu
This commit is contained in:
parent
0a995e38dc
commit
a1ed1d6caf
@ -5898,6 +5898,7 @@ static int snd_scarlett2_controls_create(
|
|||||||
struct usb_mixer_interface *mixer,
|
struct usb_mixer_interface *mixer,
|
||||||
const struct scarlett2_device_entry *entry)
|
const struct scarlett2_device_entry *entry)
|
||||||
{
|
{
|
||||||
|
struct scarlett2_data *private;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* Initialise private data */
|
/* Initialise private data */
|
||||||
@ -5905,6 +5906,8 @@ static int snd_scarlett2_controls_create(
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
private = mixer->private_data;
|
||||||
|
|
||||||
/* Send proprietary USB initialisation sequence */
|
/* Send proprietary USB initialisation sequence */
|
||||||
err = scarlett2_usb_init(mixer);
|
err = scarlett2_usb_init(mixer);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
@ -5931,7 +5934,7 @@ static int snd_scarlett2_controls_create(
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
/* If MSD mode is enabled, don't create any other controls */
|
/* If MSD mode is enabled, don't create any other controls */
|
||||||
if (((struct scarlett2_data *)mixer->private_data)->msd_switch)
|
if (private->msd_switch)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Create the analogue output controls */
|
/* Create the analogue output controls */
|
||||||
|
Loading…
Reference in New Issue
Block a user