atp870u: Improve unsupported chip detection

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Ondrej Zary 2015-11-17 19:24:18 +01:00 committed by Martin K. Petersen
parent bdd5ac4065
commit b1e850630b

View File

@ -1252,6 +1252,11 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
unsigned char setupdata[2][16]; unsigned char setupdata[2][16];
int err; int err;
if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610 && pdev->revision < 2) {
dev_err(&pdev->dev, "ATP850S chips (AEC6710L/F cards) are not supported.\n");
return -ENODEV;
}
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
goto fail; goto fail;
@ -1273,19 +1278,10 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
atpdev->pdev = pdev; atpdev->pdev = pdev;
pci_set_drvdata(pdev, atpdev); pci_set_drvdata(pdev, atpdev);
/*
* It's probably easier to weed out some revisions like
* this than via the PCI device table
*/
if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) {
atpdev->chip_ver = pdev->revision;
if (atpdev->chip_ver < 2) {
err = -ENODEV;
goto unregister;
}
}
switch (ent->device) { switch (ent->device) {
case PCI_DEVICE_ID_ARTOP_AEC7610:
atpdev->chip_ver = pdev->revision;
break;
case PCI_DEVICE_ID_ARTOP_AEC7612UW: case PCI_DEVICE_ID_ARTOP_AEC7612UW:
case PCI_DEVICE_ID_ARTOP_AEC7612SUW: case PCI_DEVICE_ID_ARTOP_AEC7612SUW:
case ATP880_DEVID1: case ATP880_DEVID1: