media: s2255: Use refcount_t instead of atomic_t for num_channels
authorRicardo Ribalda <ribalda@chromium.org>
Mon, 29 Apr 2024 15:04:50 +0000 (16:04 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 3 May 2024 10:10:58 +0000 (11:10 +0100)
commit6cff72f6bcee89228a662435b7c47e21a391c8d0
tree6307ebc80d376fef51a6cc3c11cf7835ceabaa1d
parent6a56625b9e64593339937072897938f673de8a80
media: s2255: Use refcount_t instead of atomic_t for num_channels

Use an API that resembles more the actual use of num_channels.

Found by cocci:
drivers/media/usb/s2255/s2255drv.c:2362:5-24: WARNING: atomic_dec_and_test variation before object free at line 2363.
drivers/media/usb/s2255/s2255drv.c:1557:5-24: WARNING: atomic_dec_and_test variation before object free at line 1558.

Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-11-3c4865f5a4b0@chromium.org
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/usb/s2255/s2255drv.c