--- zzzz-none-000/linux-3.10.107/sound/pci/ice1712/ews.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/ice1712/ews.c 2021-02-04 17:41:59.000000000 +0000 @@ -163,7 +163,8 @@ __error: snd_i2c_unlock(ice->i2c); - snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n"); + dev_err(ice->card->dev, + "AK4524 chip select failed, check cable to the front module\n"); return -EIO; } @@ -174,7 +175,7 @@ unsigned char tmp; /* assert AK4524 CS */ if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) - snd_printk(KERN_ERR "fatal error (ews88mt chip select)\n"); + dev_err(ice->card->dev, "fatal error (ews88mt chip select)\n"); snd_ice1712_save_gpio_status(ice); tmp = ICE1712_EWS88_SERIAL_DATA | ICE1712_EWS88_SERIAL_CLOCK | @@ -456,7 +457,7 @@ /* create i2c */ if ((err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c)) < 0) { - snd_printk(KERN_ERR "unable to create I2C bus\n"); + dev_err(ice->card->dev, "unable to create I2C bus\n"); return err; } ice->i2c->private_data = ice; @@ -469,7 +470,8 @@ ICE1712_6FIRE_PCF9554_ADDR, &spec->i2cdevs[EWS_I2C_6FIRE]); if (err < 0) { - snd_printk(KERN_ERR "PCF9554 initialization failed\n"); + dev_err(ice->card->dev, + "PCF9554 initialization failed\n"); return err; } snd_ice1712_6fire_write_pca(ice, PCF9554_REG_CONFIG, 0x80); @@ -578,13 +580,7 @@ static const char * const texts[2] = { "+4dBu", "-10dBV", }; - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 2; - if (uinfo->value.enumerated.item >= 2) - uinfo->value.enumerated.item = 1; - strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); - return 0; + return snd_ctl_enum_info(uinfo, 1, 2, texts); } static int snd_ice1712_ewx_io_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) @@ -834,7 +830,7 @@ byte = 0; if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { snd_i2c_unlock(ice->i2c); - printk(KERN_ERR "cannot read pca\n"); + dev_err(ice->card->dev, "cannot read pca\n"); return -EIO; } snd_i2c_unlock(ice->i2c); @@ -901,13 +897,7 @@ static const char * const texts[4] = { "Internal", "Front Input", "Rear Input", "Wave Table" }; - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 4; - if (uinfo->value.enumerated.item >= 4) - uinfo->value.enumerated.item = 1; - strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); - return 0; + return snd_ctl_enum_info(uinfo, 1, 4, texts); } static int snd_ice1712_6fire_select_input_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)