diff options
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/core/event.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/event.c b/drivers/gpu/drm/nouveau/core/core/event.c index 6d01e0f0fc8a..7eb81c1b6fab 100644 --- a/drivers/gpu/drm/nouveau/core/core/event.c +++ b/drivers/gpu/drm/nouveau/core/core/event.c | |||
| @@ -27,8 +27,10 @@ static void | |||
| 27 | nouveau_event_put_locked(struct nouveau_event *event, int index, | 27 | nouveau_event_put_locked(struct nouveau_event *event, int index, |
| 28 | struct nouveau_eventh *handler) | 28 | struct nouveau_eventh *handler) |
| 29 | { | 29 | { |
| 30 | if (!--event->index[index].refs) | 30 | if (!--event->index[index].refs) { |
| 31 | event->disable(event, index); | 31 | if (event->disable) |
| 32 | event->disable(event, index); | ||
| 33 | } | ||
| 32 | list_del(&handler->head); | 34 | list_del(&handler->head); |
| 33 | } | 35 | } |
| 34 | 36 | ||
| @@ -53,8 +55,10 @@ nouveau_event_get(struct nouveau_event *event, int index, | |||
| 53 | spin_lock_irqsave(&event->lock, flags); | 55 | spin_lock_irqsave(&event->lock, flags); |
| 54 | if (index < event->index_nr) { | 56 | if (index < event->index_nr) { |
| 55 | list_add(&handler->head, &event->index[index].list); | 57 | list_add(&handler->head, &event->index[index].list); |
| 56 | if (!event->index[index].refs++) | 58 | if (!event->index[index].refs++) { |
| 57 | event->enable(event, index); | 59 | if (event->enable) |
| 60 | event->enable(event, index); | ||
| 61 | } | ||
| 58 | } | 62 | } |
| 59 | spin_unlock_irqrestore(&event->lock, flags); | 63 | spin_unlock_irqrestore(&event->lock, flags); |
| 60 | } | 64 | } |
