misc: pci_endpoint_test: Fix test_reg_bar to be updated in pci_endpoint_test
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 25 Mar 2019 09:39:47 +0000 (15:09 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 1 May 2019 14:50:13 +0000 (15:50 +0100)
commit 834b90519925 ("misc: pci_endpoint_test: Add support for
PCI_ENDPOINT_TEST regs to be mapped to any BAR") while adding
test_reg_bar in order to map PCI_ENDPOINT_TEST regs to be mapped to any
BAR failed to update test_reg_bar in pci_endpoint_test, resulting in
test_reg_bar having invalid value when used outside probe.

Fix it.

Fixes: 834b90519925 ("misc: pci_endpoint_test: Add support for PCI_ENDPOINT_TEST regs to be mapped to any BAR")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/misc/pci_endpoint_test.c

index e015e8fa9bd3f900b8bf49b2bfc64e434dd5e7e3..7b015f2a1c6f43f56547be120ff3a97860876bdc 100644 (file)
@@ -670,6 +670,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
        data = (struct pci_endpoint_test_data *)ent->driver_data;
        if (data) {
                test_reg_bar = data->test_reg_bar;
+               test->test_reg_bar = test_reg_bar;
                test->alignment = data->alignment;
                irq_type = data->irq_type;
        }