提交 2c3700bb 编写于 作者: S Sebastian Ott 提交者: Martin Schwidefsky

s390/pci: return error after failed pci ops

Access to pci config space via pci_ops should not fail silently.
Reviewed-by: NGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 b170bad4
...@@ -405,20 +405,28 @@ static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, ...@@ -405,20 +405,28 @@ static int pci_read(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 *val) int size, u32 *val)
{ {
struct zpci_dev *zdev = get_zdev_by_bus(bus); struct zpci_dev *zdev = get_zdev_by_bus(bus);
int ret;
if (!zdev || devfn != ZPCI_DEVFN) if (!zdev || devfn != ZPCI_DEVFN)
return 0; ret = -ENODEV;
return zpci_cfg_load(zdev, where, val, size); else
ret = zpci_cfg_load(zdev, where, val, size);
return ret;
} }
static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, static int pci_write(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 val) int size, u32 val)
{ {
struct zpci_dev *zdev = get_zdev_by_bus(bus); struct zpci_dev *zdev = get_zdev_by_bus(bus);
int ret;
if (!zdev || devfn != ZPCI_DEVFN) if (!zdev || devfn != ZPCI_DEVFN)
return 0; ret = -ENODEV;
return zpci_cfg_store(zdev, where, val, size); else
ret = zpci_cfg_store(zdev, where, val, size);
return ret;
} }
static struct pci_ops pci_root_ops = { static struct pci_ops pci_root_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册