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

Commit e405d025 authored by Nirav Shah's avatar Nirav Shah
Browse files

cnss2: Return failure if bus type do not match



Return failure in bus register if bus_type do not
match between cnss and wlan driver.

Change-Id: I9c322e4f6eca3220f1de18a6031715381ba495d7
Signed-off-by: default avatarNirav Shah <nnshah@codeaurora.org>
parent 77c04577
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -749,6 +749,12 @@ int cnss_wlan_register_driver(struct cnss_wlan_driver *driver_ops)
		return -ENODEV;
	}

	if (plat_priv->bus_type != CNSS_BUS_PCI) {
		cnss_pr_err("Wrong bus type. Expected bus_type %d\n",
			    plat_priv->bus_type);
		return -EFAULT;
	}

	pci_priv = plat_priv->bus_priv;
	if (!pci_priv) {
		cnss_pr_err("pci_priv is NULL\n");
+6 −0
Original line number Diff line number Diff line
@@ -73,6 +73,12 @@ int cnss_usb_wlan_register_driver(struct cnss_usb_wlan_driver *driver_ops)
		return -ENODEV;
	}

	if (plat_priv->bus_type != CNSS_BUS_USB) {
		cnss_pr_err("Wrong bus type. Expected bus_type %d\n",
			    plat_priv->bus_type);
		return -EFAULT;
	}

	usb_priv = plat_priv->bus_priv;
	usb_priv->plat_priv = plat_priv;