Commit 91dd71e5 authored by Dave Jones's avatar Dave Jones

[AGP] Clean up atomic usage of agp_bridge.agp_in_use

parent fcbdf76e
......@@ -49,12 +49,10 @@ int agp_backend_acquire(void)
if (agp_bridge.type == NOT_SUPPORTED)
return -EINVAL;
atomic_inc(&agp_bridge.agp_in_use);
if (atomic_read(&agp_bridge.agp_in_use) != 1) {
atomic_dec(&agp_bridge.agp_in_use);
if (atomic_read(&agp_bridge.agp_in_use) != 0)
return -EBUSY;
}
atomic_inc(&agp_bridge.agp_in_use);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment