RE: [SOLVED] Enable IR on hdpvr

Jason Gauthier
2011-05-22T02:02:18Z

All,

>Okay, so I emailed a little too quickly. The messages above got me thinking. One of them is successful the other is not.
>I verified with irsend. So, this may be an issue with multiple hdpvrs.

I believe I've tracked this down.

In lirc_zilog.c:

At 1307:
ret = add_ir_device(ir);
if (ret)
goto out_free_ir;

Looking at add_ir_device:
It returns:

return i == MAX_IRCTL_DEVICES ? -ENOMEM : i;

Meaning, that with a single device, it will generally return 0. However, if there are multiple devices it will return a positive. This causes the return check to succeeed, and the goto out_free_ir, and basically doesn't continue.

So, simply changing the check to if (ret<0) seems to resolve this. Then if -ENOMEM is returned it will fail, and otherwise succeed.

Sorry, this is not an official patch. The maintainer (Jarod?) should be able to see what I am talking about and correct this.

Thanks!

Jasoin