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

Commit 7d7b33d6 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

Input: adbhid - do not access input_dev->private directly



Use input_get_drvdata() and input_set_drvdata() helpers to do that.

Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 18cc6757
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -628,14 +628,14 @@ static void real_leds(unsigned char leds, int device)
 */
static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
	struct adbhid *adbhid = dev->private;
	struct adbhid *adbhid = input_get_drvdata(dev);
	unsigned char leds;

	switch (type) {
	case EV_LED:
	  leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0)
	       | (test_bit(LED_NUML,    dev->led) ? 1 : 0)
	       | (test_bit(LED_CAPSL,   dev->led) ? 2 : 0);
		leds =  (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) |
			(test_bit(LED_NUML,    dev->led) ? 1 : 0) |
			(test_bit(LED_CAPSL,   dev->led) ? 2 : 0);
		real_leds(leds, adbhid->id);
		return 0;
	}
@@ -699,7 +699,7 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
	hid->current_handler_id = current_handler_id;
	hid->mouse_kind = mouse_kind;
	hid->flags = 0;
	input_dev->private = hid;
	input_set_drvdata(input_dev, hid);
	input_dev->name = hid->name;
	input_dev->phys = hid->phys;
	input_dev->id.bustype = BUS_ADB;