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

Commit c5540fbb authored by David Härdeman's avatar David Härdeman Committed by Mauro Carvalho Chehab
Browse files

[media] rc-core: remove protocol arrays



The basic API of rc-core used to be:

	dev = rc_allocate_device();
	dev->x = a;
	dev->y = b;
	dev->z = c;
	rc_register_device();

which is a pretty common pattern in the kernel, after the introduction of
protocol arrays the API looks something like:

	dev = rc_allocate_device();
	dev->x = a;
	rc_set_allowed_protocols(dev, RC_BIT_X);
	dev->z = c;
	rc_register_device();

There's no real need for the protocols to be an array, so change it
back to be consistent (and in preparation for the following patches).

[m.chehab@samsung.com: added missing changes at some files]
Signed-off-by: default avatarDavid Härdeman <david@hardeman.nu>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent da6e162d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ int picolcd_init_cir(struct picolcd_data *data, struct hid_report *report)

	rdev->priv             = data;
	rdev->driver_type      = RC_DRIVER_IR_RAW;
	rc_set_allowed_protocols(rdev, RC_BIT_ALL);
	rdev->allowed_protocols = RC_BIT_ALL;
	rdev->open             = picolcd_cir_open;
	rdev->close            = picolcd_cir_close;
	rdev->input_name       = data->hdev->name;
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ int sms_ir_init(struct smscore_device_t *coredev)

	dev->priv = coredev;
	dev->driver_type = RC_DRIVER_IR_RAW;
	rc_set_allowed_protocols(dev, RC_BIT_ALL);
	dev->allowed_protocols = RC_BIT_ALL;
	dev->map_name = sms_get_board(board_id)->rc_codes;
	dev->driver_name = MODULE_NAME;

+2 −2
Original line number Diff line number Diff line
@@ -432,8 +432,8 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
	 * Initialize the other fields of rc_dev
	 */
	rc->map_name       = ir->ir_codes;
	rc_set_allowed_protocols(rc, rc_type);
	rc_set_enabled_protocols(rc, rc_type);
	rc->allowed_protocols = rc_type;
	rc->enabled_protocols = rc_type;
	if (!rc->driver_name)
		rc->driver_name = MODULE_NAME;

+1 −1
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
	}
	rc->dev.parent = &dev->pci->dev;
	rc->driver_type = driver_type;
	rc_set_allowed_protocols(rc, allowed_protos);
	rc->allowed_protocols = allowed_protos;
	rc->priv = kernel_ir;
	rc->open = cx23885_input_ir_open;
	rc->close = cx23885_input_ir_close;
+1 −1
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
		dev->timeout = 10 * 1000 * 1000; /* 10 ms */
	} else {
		dev->driver_type = RC_DRIVER_SCANCODE;
		rc_set_allowed_protocols(dev, rc_type);
		dev->allowed_protocols = rc_type;
	}

	ir->core = core;
Loading