On Fri, Aug 16, 2013 at 06:00:08PM +0100, Srinivas KANDAGATLA wrote:
> + adding Mauro Chehab
> On 16/08/13 17:51, Hans Petter Selasky wrote:
> > Hi Jurgen,
> > 
> > I think this is something broken at the Linux side or I have sources out of 
> > sync.
> > You should just ignore the NULL function pointer, hence the technisat 
> > driver does not have these callbacks. 
> 
> I agree, I was under the impression that open/close are mandatory.
> 
> Can you please send a patch to fix this to linux-media@vger.kernel.org.
> 
> Thanks,
> srini
> 
At least technisat-usb2.c doesn't set these...

Signed-off-by: Juergen Lock <n...@jelal.kn-bremen.de>

--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -707,7 +707,7 @@ int rc_open(struct rc_dev *rdev)
                return -EINVAL;
 
        mutex_lock(&rdev->lock);
-       if (!rdev->users++)
+       if (!rdev->users++ && rdev->open != NULL)
                rval = rdev->open(rdev);
 
        if (rval)
@@ -731,7 +731,7 @@ void rc_close(struct rc_dev *rdev)
        if (rdev) {
                mutex_lock(&rdev->lock);
 
-                if (!--rdev->users)
+                if (!--rdev->users && rdev->close != NULL)
                        rdev->close(rdev);
 
                mutex_unlock(&rdev->lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to