Commit b1e850630b746e347f80cb3f70bdaa791c10b4f6
Committed by
Martin K. Petersen
1 parent
bdd5ac4065
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>
Showing 1 changed file with 8 additions and 12 deletions Side-by-side Diff
drivers/scsi/atp870u.c
... | ... | @@ -1252,6 +1252,11 @@ |
1252 | 1252 | unsigned char setupdata[2][16]; |
1253 | 1253 | int err; |
1254 | 1254 | |
1255 | + if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610 && pdev->revision < 2) { | |
1256 | + dev_err(&pdev->dev, "ATP850S chips (AEC6710L/F cards) are not supported.\n"); | |
1257 | + return -ENODEV; | |
1258 | + } | |
1259 | + | |
1255 | 1260 | err = pci_enable_device(pdev); |
1256 | 1261 | if (err) |
1257 | 1262 | goto fail; |
1258 | 1263 | |
... | ... | @@ -1273,19 +1278,10 @@ |
1273 | 1278 | atpdev->pdev = pdev; |
1274 | 1279 | pci_set_drvdata(pdev, atpdev); |
1275 | 1280 | |
1276 | - /* | |
1277 | - * It's probably easier to weed out some revisions like | |
1278 | - * this than via the PCI device table | |
1279 | - */ | |
1280 | - if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) { | |
1281 | - atpdev->chip_ver = pdev->revision; | |
1282 | - if (atpdev->chip_ver < 2) { | |
1283 | - err = -ENODEV; | |
1284 | - goto unregister; | |
1285 | - } | |
1286 | - } | |
1287 | - | |
1288 | 1281 | switch (ent->device) { |
1282 | + case PCI_DEVICE_ID_ARTOP_AEC7610: | |
1283 | + atpdev->chip_ver = pdev->revision; | |
1284 | + break; | |
1289 | 1285 | case PCI_DEVICE_ID_ARTOP_AEC7612UW: |
1290 | 1286 | case PCI_DEVICE_ID_ARTOP_AEC7612SUW: |
1291 | 1287 | case ATP880_DEVID1: |