Staging: hv: storvsc: Cleanup alloc_stor_device()
authorK. Y. Srinivasan <kys@microsoft.com>
Sat, 27 Aug 2011 18:31:04 +0000 (11:31 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 29 Aug 2011 18:01:02 +0000 (11:01 -0700)
Cleanup alloc_stor_device(), we can set the ref_count directly.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/storvsc.c

index 313a3f8cfaf31b2de2994c824fcd263908a44f8b..48bd8dae02e358a5c18ad95c3cabb8656ee7197d 100644 (file)
@@ -42,7 +42,7 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
 
        /* Set to 2 to allow both inbound and outbound traffics */
        /* (ie get_out_stor_device() and get_in_stor_device()) to proceed. */
-       atomic_cmpxchg(&stor_device->ref_count, 0, 2);
+       atomic_set(&stor_device->ref_count, 2);
 
        init_waitqueue_head(&stor_device->waiting_to_drain);
        stor_device->device = device;