Mauro Carvalho Chehab | 30 Jun 2012 19:31
Picon
Favicon

[PATCH] [media] tuner-xc2028: use request_firmware_nowait()

Change the firmware logic to use request_firmware_nowait(), and
to preserve the loaded firmwares in memory, to reduce the risk
of troubles with buggy userspace apps.

With this change, while the firmware is being loaded, the driver
will return -EAGAIN to any calls. If, for some reason, firmware
failed to be loaded from userspace, it will return -ENODEV.

Signed-off-by: Mauro Carvalho Chehab <mchehab <at> redhat.com>
---
 drivers/media/common/tuners/tuner-xc2028.c |  178 ++++++++++++++++++++--------
 1 file changed, 129 insertions(+), 49 deletions(-)

diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index b5ee3eb..9638a69 100644
--- a/drivers/media/common/tuners/tuner-xc2028.c
+++ b/drivers/media/common/tuners/tuner-xc2028.c
 <at>  <at>  -90,11 +90,22  <at>  <at>  struct firmware_properties {
 	int 		scode_nr;
 };

+enum xc2028_state {
+	XC2028_NO_FIRMWARE = 0,
+	XC2028_WAITING_FIRMWARE,
+	XC2028_ACTIVE,
+	XC2028_SLEEP,
+	XC2028_NODEV,
+};
+
 struct xc2028_data {
(Continue reading)


Gmane