staging: unisys: visorbus: fix vbus info generated for s-Par livedumps
authorTim Sell <Timothy.Sell@unisys.com>
Tue, 27 Sep 2016 18:42:22 +0000 (14:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2016 09:30:52 +0000 (11:30 +0200)
Previously, the lines describing devices controlled by the visorinput,
visornic, and visorhba drivers (keyboard, mouse, ultravnic, sparvhba) would
be missing from the vbus channel header.  This is important info that is
collected as part of s-Par livedumps, and can be examined via
/sys/bus/visorbus/devices/visorbus<n>/client_bus_info, e.g.:

    $ pwd
    /sys/bus/visorbus/devices
    $ cat visorbus1/client_bus_info
    Client device / client driver info for s-Par Console eartition
                                                 (vbus #4294967295):
       chipset         visorchipset    kernel ver. 4.8.0-rc6-ARCH+
       clientbus       visorbus        kernel ver. 4.8.0-rc6-ARCH+
 -> [2]keyboard        visorinput      kernel ver. 4.8.0-rc6-ARCH+
 -> [3]mouse           visorinput      kernel ver. 4.8.0-rc6-ARCH+

    $ cat visorbus2/client_bus_info
    Client device / client driver info for s-Par IOVM eartition
                                                 (vbus #4294967295):
       chipset         visorchipset    kernel ver. 4.8.0-rc6-ARCH+
       clientbus       visorbus        kernel ver. 4.8.0-rc6-ARCH+
 -> [0]ultravnic       visornic        kernel ver. 4.8.0-rc6-ARCH+
 -> [1]ultravnic       visornic        kernel ver. 4.8.0-rc6-ARCH+
 -> [2]sparvhba        visorhba        kernel ver. 4.8.0-rc6-ARCH+

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c

index ccdb5a1f45d94f8eb7465ce93e2fd479e90c392b..2b4abda0fa9e59836fe4db8aea66b8a4fdbcfc06 100644 (file)
@@ -796,14 +796,12 @@ fix_vbus_dev_info(struct visor_device *visordev)
        if (!visordev->device.driver)
                return;
 
-       hdr_info = (struct spar_vbus_headerinfo *)visordev->vbus_hdr_info;
-       if (!hdr_info)
-               return;
-
        bdev = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
        if (!bdev)
                return;
-
+       hdr_info = (struct spar_vbus_headerinfo *)bdev->vbus_hdr_info;
+       if (!hdr_info)
+               return;
        visordrv = to_visor_driver(visordev->device.driver);
 
        /*