Skip to content

Commit

Permalink
s390/pci: return error after failed pci ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Apr 17, 2013
1 parent b170bad commit 2c3700b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions arch/s390/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,20 +405,28 @@ static int pci_read(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 *val)
{
struct zpci_dev *zdev = get_zdev_by_bus(bus);
int ret;

if (!zdev || devfn != ZPCI_DEVFN)
return 0;
return zpci_cfg_load(zdev, where, val, size);
ret = -ENODEV;
else
ret = zpci_cfg_load(zdev, where, val, size);

return ret;
}

static int pci_write(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 val)
{
struct zpci_dev *zdev = get_zdev_by_bus(bus);
int ret;

if (!zdev || devfn != ZPCI_DEVFN)
return 0;
return zpci_cfg_store(zdev, where, val, size);
ret = -ENODEV;
else
ret = zpci_cfg_store(zdev, where, val, size);

return ret;
}

static struct pci_ops pci_root_ops = {
Expand Down

0 comments on commit 2c3700b

Please sign in to comment.