~ubuntu-branches/ubuntu/karmic/linux-mvl-dove/karmic-proposed

« back to all changes in this revision

Viewing changes to drivers/input/evdev.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader
  • Date: 2010-03-10 22:24:12 UTC
  • mto: (15.1.2 karmic-security)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20100310222412-k86m3r53jw0je7x1
Tags: upstream-2.6.31
ImportĀ upstreamĀ versionĀ 2.6.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        struct input_handle handle;
29
29
        wait_queue_head_t wait;
30
30
        struct evdev_client *grab;
31
 
        int grab_exclusive;
32
31
        struct list_head client_list;
33
32
        spinlock_t client_lock; /* protects client_list */
34
33
        struct mutex mutex;
80
79
        rcu_read_lock();
81
80
 
82
81
        client = rcu_dereference(evdev->grab);
83
 
        if (client && evdev->grab_exclusive)
 
82
        if (client)
84
83
                evdev_pass_event(client, &event);
85
84
        else
86
85
                list_for_each_entry_rcu(client, &evdev->client_list, node)
154
153
        rcu_assign_pointer(evdev->grab, NULL);
155
154
        synchronize_rcu();
156
155
        input_release_device(&evdev->handle);
157
 
        evdev->grab_exclusive = 0;
158
156
 
159
157
        return 0;
160
158
}
578
576
                return 0;
579
577
 
580
578
        case EVIOCGRAB:
581
 
 
582
579
                if (p)
583
 
                {
584
 
                        error = evdev_grab(evdev, client);
585
 
                        if(error == 0)
586
 
                                evdev->grab_exclusive = ((long)p == 1);
587
 
                        return error;
588
 
                }
 
580
                        return evdev_grab(evdev, client);
589
581
                else
590
582
                        return evdev_ungrab(evdev, client);
591
583