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

Commit e99eac5e authored by Seth Forshee's avatar Seth Forshee Committed by Matthew Garrett
Browse files

vga_switcheroo: Don't require handler init callback



This callback is a no-op in nouveau, and the upcoming apple-gmux
switcheroo support won't require it either. Rather than forcing drivers
to stub it out, just make it optional and remove the callback from
nouveau.

Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 36704c0c
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -211,11 +211,6 @@ static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id,
	return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dhandle, state);
}

static int nouveau_dsm_init(void)
{
	return 0;
}

static int nouveau_dsm_get_client_id(struct pci_dev *pdev)
{
	/* easy option one - intel vendor ID means Integrated */
@@ -232,7 +227,6 @@ static int nouveau_dsm_get_client_id(struct pci_dev *pdev)
static struct vga_switcheroo_handler nouveau_dsm_handler = {
	.switchto = nouveau_dsm_switchto,
	.power_state = nouveau_dsm_power_state,
	.init = nouveau_dsm_init,
	.get_client_id = nouveau_dsm_get_client_id,
};

+2 −1
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ static void vga_switcheroo_enable(void)
	struct vga_switcheroo_client *client;

	/* call the handler to init */
	if (vgasr_priv.handler->init)
		vgasr_priv.handler->init();

	list_for_each_entry(client, &vgasr_priv.clients, list) {