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

Commit 7ef68e60 authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (13236): ir-kbd-i2c: Don't reject unknown I2C addresses



I do not think it makes sense any longer for ir-kbd-i2c to reject
devices at unknown I2C addresses. The caller can provide all the
details about how the device should be handled. Having to add new
addresses to ir-kbd-i2c so that they aren't rejected is a pain we
don't need. Unsupported devices will be spotted a few lines later
anyway.

This already lets us unlist 2 addresses (0x7a and 0x2d) for which
handling details are always provided by the caller (saa7134-input).
Hopefully we can remove more in the future.

Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 30093e8b
Loading
Loading
Loading
Loading
+2 −8
Original line number Original line Diff line number Diff line
@@ -299,7 +299,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
{
	struct ir_scancode_table *ir_codes = NULL;
	struct ir_scancode_table *ir_codes = NULL;
	const char *name = NULL;
	const char *name = NULL;
	int ir_type;
	int ir_type = 0;
	struct IR_i2c *ir;
	struct IR_i2c *ir;
	struct input_dev *input_dev;
	struct input_dev *input_dev;
	struct i2c_adapter *adap = client->adapter;
	struct i2c_adapter *adap = client->adapter;
@@ -353,10 +353,8 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
		ir_type     = IR_TYPE_RC5;
		ir_type     = IR_TYPE_RC5;
		ir_codes    = &ir_codes_fusionhdtv_mce_table;
		ir_codes    = &ir_codes_fusionhdtv_mce_table;
		break;
		break;
	case 0x7a:
	case 0x47:
	case 0x47:
	case 0x71:
	case 0x71:
	case 0x2d:
		if (adap->id == I2C_HW_B_CX2388x ||
		if (adap->id == I2C_HW_B_CX2388x ||
		    adap->id == I2C_HW_B_CX2341X) {
		    adap->id == I2C_HW_B_CX2341X) {
			/* Handled by cx88-input */
			/* Handled by cx88-input */
@@ -381,10 +379,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
		ir_type     = IR_TYPE_OTHER;
		ir_type     = IR_TYPE_OTHER;
		ir_codes    = &ir_codes_avermedia_cardbus_table;
		ir_codes    = &ir_codes_avermedia_cardbus_table;
		break;
		break;
	default:
		dprintk(1, DEVNAME ": Unsupported i2c address 0x%02x\n", addr);
		err = -ENODEV;
		goto err_out_free;
	}
	}


	/* Let the caller override settings */
	/* Let the caller override settings */
@@ -427,7 +421,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
	}
	}


	/* Make sure we are all setup before going on */
	/* Make sure we are all setup before going on */
	if (!name || !ir->get_key || !ir_codes) {
	if (!name || !ir->get_key || !ir_type || !ir_codes) {
		dprintk(1, DEVNAME ": Unsupported device at address 0x%02x\n",
		dprintk(1, DEVNAME ": Unsupported device at address 0x%02x\n",
			addr);
			addr);
		err = -ENODEV;
		err = -ENODEV;