diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2013-04-16 08:18:41 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-04-17 08:07:38 -0400 |
commit | 2c3700bbb2c9c9c1d10f930d400f573d55f8e750 (patch) | |
tree | 196296aa3f080e430d183e8ba9440e4f32b1f8b0 /arch/s390/pci | |
parent | b170bad40dab1a1684d629b37cb65a5281d35bd8 (diff) |
s390/pci: return error after failed pci ops
Access to pci config space via pci_ops should not fail silently.
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r-- | arch/s390/pci/pci.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 51d16f1fb5ea..6a054bf83eb0 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c | |||
@@ -405,20 +405,28 @@ static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, | |||
405 | int size, u32 *val) | 405 | int size, u32 *val) |
406 | { | 406 | { |
407 | struct zpci_dev *zdev = get_zdev_by_bus(bus); | 407 | struct zpci_dev *zdev = get_zdev_by_bus(bus); |
408 | int ret; | ||
408 | 409 | ||
409 | if (!zdev || devfn != ZPCI_DEVFN) | 410 | if (!zdev || devfn != ZPCI_DEVFN) |
410 | return 0; | 411 | ret = -ENODEV; |
411 | return zpci_cfg_load(zdev, where, val, size); | 412 | else |
413 | ret = zpci_cfg_load(zdev, where, val, size); | ||
414 | |||
415 | return ret; | ||
412 | } | 416 | } |
413 | 417 | ||
414 | static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, | 418 | static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, |
415 | int size, u32 val) | 419 | int size, u32 val) |
416 | { | 420 | { |
417 | struct zpci_dev *zdev = get_zdev_by_bus(bus); | 421 | struct zpci_dev *zdev = get_zdev_by_bus(bus); |
422 | int ret; | ||
418 | 423 | ||
419 | if (!zdev || devfn != ZPCI_DEVFN) | 424 | if (!zdev || devfn != ZPCI_DEVFN) |
420 | return 0; | 425 | ret = -ENODEV; |
421 | return zpci_cfg_store(zdev, where, val, size); | 426 | else |
427 | ret = zpci_cfg_store(zdev, where, val, size); | ||
428 | |||
429 | return ret; | ||
422 | } | 430 | } |
423 | 431 | ||
424 | static struct pci_ops pci_root_ops = { | 432 | static struct pci_ops pci_root_ops = { |