We now pass the device to the debug messages, but on non-x86,
this is an invalid pointer in vga_arb_device_init:
drivers/gpu/vga/vgaarb.c: In function 'vga_arb_device_init':
drivers/gpu/vga/vgaarb.c:1467:4: error: 'dev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This moves the initialization of the dev pointer outside of the
architecture #ifdef.
Fixes: a75d68f62106 ("vgaarb: Use dev_printk() when possible")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161122143445.1896558-1-arnd@arndb.de
        int rc;
        struct pci_dev *pdev;
        struct vga_device *vgadev;
-       struct device *dev;
 
        rc = misc_register(&vga_arb_device);
        if (rc < 0)
                vga_arbiter_add_pci_device(pdev);
 
        list_for_each_entry(vgadev, &vga_list, list) {
+               struct device *dev = &vgadev->pdev->dev;
 #if defined(CONFIG_X86) || defined(CONFIG_IA64)
                /*
                 * Override vga_arbiter_add_pci_device()'s I/O based detection
                int i;
 
                limit = screen_info.lfb_base + screen_info.lfb_size;
-               dev = &vgadev->pdev->dev;
 
                /* Does firmware framebuffer belong to us? */
                for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {