Commit da77b546 authored by Sean Young's avatar Sean Young Committed by Greg Kroah-Hartman

media: rc: ensure close() is called on rc_unregister_device

[ Upstream commit 8e782fcf ]

If userspace has an open file descriptor on the rc input device or lirc
device when rc_unregister_device() is called, then the rc close() is
never called.

This ensures that the receiver is turned off on the nuvoton-cir driver
during shutdown.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b0b10168
...@@ -1956,6 +1956,8 @@ void rc_unregister_device(struct rc_dev *dev) ...@@ -1956,6 +1956,8 @@ void rc_unregister_device(struct rc_dev *dev)
rc_free_rx_device(dev); rc_free_rx_device(dev);
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
if (dev->users && dev->close)
dev->close(dev);
dev->registered = false; dev->registered = false;
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment