Merge tag 'amd-drm-next-5.7-2020-02-26' of git://people.freedesktop.org/~agd5f/linux...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_device.c
index 7878698e562d4271269f532c855b28dab613aff7..a3aaf2e3794cebfeb10479e083e5e1415871f3b7 100644 (file)
@@ -1167,7 +1167,7 @@ static bool amdgpu_switcheroo_can_switch(struct pci_dev *pdev)
        * locking inversion with the driver load path. And the access here is
        * completely racy anyway. So don't bother with locking for now.
        */
-       return dev->open_count == 0;
+       return atomic_read(&dev->open_count) == 0;
 }
 
 static const struct vga_switcheroo_client_ops amdgpu_switcheroo_ops = {