Commit 01f681da authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Fix invalid assignment of PCI revision

Fix the type of PCI revision to char from int and avoid invalid
assignment with pointer cast.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent e3a5d59a
...@@ -286,7 +286,7 @@ struct snd_ymfpci { ...@@ -286,7 +286,7 @@ struct snd_ymfpci {
int irq; int irq;
unsigned int device_id; /* PCI device ID */ unsigned int device_id; /* PCI device ID */
unsigned int rev; /* PCI revision */ unsigned char rev; /* PCI revision */
unsigned long reg_area_phys; unsigned long reg_area_phys;
void __iomem *reg_area_virt; void __iomem *reg_area_virt;
struct resource *res_reg_area; struct resource *res_reg_area;
......
...@@ -590,7 +590,7 @@ struct snd_ca0106 { ...@@ -590,7 +590,7 @@ struct snd_ca0106 {
struct resource *res_port; struct resource *res_port;
int irq; int irq;
unsigned int revision; /* chip revision */ unsigned char revision; /* chip revision */
unsigned int serial; /* serial number */ unsigned int serial; /* serial number */
unsigned short model; /* subsystem id */ unsigned short model; /* subsystem id */
......
...@@ -1283,7 +1283,7 @@ static int __devinit snd_ca0106_create(struct snd_card *card, ...@@ -1283,7 +1283,7 @@ static int __devinit snd_ca0106_create(struct snd_card *card,
pci_set_master(pci); pci_set_master(pci);
/* read revision & serial */ /* read revision & serial */
pci_read_config_byte(pci, PCI_REVISION_ID, (char *)&chip->revision); pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision);
pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial); pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model); pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
#if 1 #if 1
......
...@@ -235,7 +235,7 @@ struct emu10k1x { ...@@ -235,7 +235,7 @@ struct emu10k1x {
struct resource *res_port; struct resource *res_port;
int irq; int irq;
unsigned int revision; /* chip revision */ unsigned char revision; /* chip revision */
unsigned int serial; /* serial number */ unsigned int serial; /* serial number */
unsigned short model; /* subsystem id */ unsigned short model; /* subsystem id */
...@@ -943,7 +943,7 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card, ...@@ -943,7 +943,7 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
pci_set_master(pci); pci_set_master(pci);
/* read revision & serial */ /* read revision & serial */
pci_read_config_byte(pci, PCI_REVISION_ID, (char *)&chip->revision); pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision);
pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial); pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model); pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
snd_printk(KERN_INFO "Model %04x Rev %08x Serial %08x\n", chip->model, snd_printk(KERN_INFO "Model %04x Rev %08x Serial %08x\n", chip->model,
......
...@@ -2291,7 +2291,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card, ...@@ -2291,7 +2291,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
chip->pci = pci; chip->pci = pci;
chip->irq = -1; chip->irq = -1;
chip->device_id = pci->device; chip->device_id = pci->device;
pci_read_config_byte(pci, PCI_REVISION_ID, (u8 *)&chip->rev); pci_read_config_byte(pci, PCI_REVISION_ID, &chip->rev);
chip->reg_area_phys = pci_resource_start(pci, 0); chip->reg_area_phys = pci_resource_start(pci, 0);
chip->reg_area_virt = ioremap_nocache(chip->reg_area_phys, 0x8000); chip->reg_area_virt = ioremap_nocache(chip->reg_area_phys, 0x8000);
pci_set_master(pci); pci_set_master(pci);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment