Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3e456cb authored by Rafi Rubin's avatar Rafi Rubin Committed by Mauro Carvalho Chehab
Browse files

[media] mceusb: Timeout unit corrections



Unit missmatch in mceusb_handle_command.  It should be converting to us,
not 1/10th of ms.

mceusb_dev_printdata 100us/ms -> 1000us/ms

Alter format of fix slightly and update comment to match proper reality.

Signed-off-by: default avatarRafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d7515b88
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -558,9 +558,10 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
				 inout, data1);
				 inout, data1);
			break;
			break;
		case MCE_CMD_S_TIMEOUT:
		case MCE_CMD_S_TIMEOUT:
			/* value is in units of 50us, so x*50/100 or x/2 ms */
			/* value is in units of 50us, so x*50/1000 ms */
			dev_info(dev, "%s receive timeout of %d ms\n",
			dev_info(dev, "%s receive timeout of %d ms\n",
				 inout, ((data1 << 8) | data2) / 2);
				 inout,
				 ((data1 << 8) | data2) * MCE_TIME_UNIT / 1000);
			break;
			break;
		case MCE_CMD_G_TIMEOUT:
		case MCE_CMD_G_TIMEOUT:
			dev_info(dev, "Get receive timeout\n");
			dev_info(dev, "Get receive timeout\n");
@@ -847,7 +848,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index)
	switch (ir->buf_in[index]) {
	switch (ir->buf_in[index]) {
	/* 2-byte return value commands */
	/* 2-byte return value commands */
	case MCE_CMD_S_TIMEOUT:
	case MCE_CMD_S_TIMEOUT:
		ir->rc->timeout = US_TO_NS((hi << 8 | lo) / 2);
		ir->rc->timeout = US_TO_NS((hi << 8 | lo) * MCE_TIME_UNIT);
		break;
		break;


	/* 1-byte return value commands */
	/* 1-byte return value commands */