Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] cx88: don't use atomic_t for core->users

users is always read or written with core->lock held. A plain int is
simpler and faster.

Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Jonathan Nieder and committed by
Mauro Carvalho Chehab
8d115931 f4bd4be8

+4 -3
+3 -2
drivers/media/video/cx88/cx88-video.c
··· 824 824 call_all(core, tuner, s_radio); 825 825 } 826 826 827 - atomic_inc(&core->users); 827 + core->users++; 828 828 mutex_unlock(&core->lock); 829 829 830 830 return 0; ··· 922 922 file->private_data = NULL; 923 923 kfree(fh); 924 924 925 - if(atomic_dec_and_test(&dev->core->users)) 925 + dev->core->users--; 926 + if (!dev->core->users) 926 927 call_all(dev->core, core, s_power, 0); 927 928 mutex_unlock(&dev->core->lock); 928 929
+1 -1
drivers/media/video/cx88/cx88.h
··· 389 389 struct mutex lock; 390 390 /* various v4l controls */ 391 391 u32 freq; 392 - atomic_t users; 392 + int users; 393 393 int mpeg_users; 394 394 395 395 /* cx88-video needs to access cx8802 for hybrid tuner pll access. */