Commit 813ba8d1 authored by Vikram Narayanan's avatar Vikram Narayanan

foobar: Use test_and_set_bit instead of set_bit

parent 1870ebda
......@@ -24,7 +24,9 @@ int register_foobar(struct foobar_device *dev)
goto out;
}
}
set_bit(FOOBAR_REGISTERED, &dev->state);
if (test_and_set_bit(FOOBAR_REGISTERED, &dev->state))
printk("WARNING: Foobar already registered\n");
printk("%s, foobar registered\n", __func__);
out:
......
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