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

Commit 2e4d242c authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

sony-laptop: fit input devices into sysfs tree



Properly set up parent on input devices registered by sony-laptop.

Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Acked-by: default avatarMattia Dongili <malattia@linux.it>
parent eb76c5c0
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -338,7 +338,7 @@ static void sony_laptop_report_input_event(u8 event)
		dprintk("unknown input event %.2x\n", event);
		dprintk("unknown input event %.2x\n", event);
}
}


static int sony_laptop_setup_input(void)
static int sony_laptop_setup_input(struct acpi_device *acpi_device)
{
{
	struct input_dev *jog_dev;
	struct input_dev *jog_dev;
	struct input_dev *key_dev;
	struct input_dev *key_dev;
@@ -379,6 +379,7 @@ static int sony_laptop_setup_input(void)
	key_dev->name = "Sony Vaio Keys";
	key_dev->name = "Sony Vaio Keys";
	key_dev->id.bustype = BUS_ISA;
	key_dev->id.bustype = BUS_ISA;
	key_dev->id.vendor = PCI_VENDOR_ID_SONY;
	key_dev->id.vendor = PCI_VENDOR_ID_SONY;
	key_dev->dev.parent = &acpi_device->dev;


	/* Initialize the Input Drivers: special keys */
	/* Initialize the Input Drivers: special keys */
	set_bit(EV_KEY, key_dev->evbit);
	set_bit(EV_KEY, key_dev->evbit);
@@ -410,6 +411,7 @@ static int sony_laptop_setup_input(void)
	jog_dev->name = "Sony Vaio Jogdial";
	jog_dev->name = "Sony Vaio Jogdial";
	jog_dev->id.bustype = BUS_ISA;
	jog_dev->id.bustype = BUS_ISA;
	jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
	jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
	key_dev->dev.parent = &acpi_device->dev;


	jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
	jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
	jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
	jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
@@ -1006,7 +1008,7 @@ static int sony_nc_add(struct acpi_device *device)
	}
	}


	/* setup input devices and helper fifo */
	/* setup input devices and helper fifo */
	result = sony_laptop_setup_input();
	result = sony_laptop_setup_input(device);
	if (result) {
	if (result) {
		printk(KERN_ERR DRV_PFX
		printk(KERN_ERR DRV_PFX
				"Unabe to create input devices.\n");
				"Unabe to create input devices.\n");
@@ -2453,7 +2455,7 @@ static int sony_pic_add(struct acpi_device *device)
	}
	}


	/* setup input devices and helper fifo */
	/* setup input devices and helper fifo */
	result = sony_laptop_setup_input();
	result = sony_laptop_setup_input(device);
	if (result) {
	if (result) {
		printk(KERN_ERR DRV_PFX
		printk(KERN_ERR DRV_PFX
				"Unabe to create input devices.\n");
				"Unabe to create input devices.\n");