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

Commit 65bf8753 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "char: msm_smd_pkt: Add warning to driver removal function"

parents 909d5eff 15e46a1c
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -1014,6 +1014,7 @@ exit:
static void smd_pkt_remove_driver(struct smd_pkt_dev *smd_pkt_devp)
static void smd_pkt_remove_driver(struct smd_pkt_dev *smd_pkt_devp)
{
{
	struct smd_pkt_driver *smd_pkt_driverp;
	struct smd_pkt_driver *smd_pkt_driverp;
	bool found_item = false;


	if (!smd_pkt_devp) {
	if (!smd_pkt_devp) {
		pr_err("%s on a NULL device\n", __func__);
		pr_err("%s on a NULL device\n", __func__);
@@ -1026,6 +1027,7 @@ static void smd_pkt_remove_driver(struct smd_pkt_dev *smd_pkt_devp)
	list_for_each_entry(smd_pkt_driverp, &smd_pkt_driver_list, list) {
	list_for_each_entry(smd_pkt_driverp, &smd_pkt_driver_list, list) {
		if (!strcmp(smd_pkt_driverp->pdriver_name,
		if (!strcmp(smd_pkt_driverp->pdriver_name,
					smd_pkt_devp->ch_name)) {
					smd_pkt_devp->ch_name)) {
			found_item = true;
			D_STATUS("%s:%s Platform driver cnt:%d\n",
			D_STATUS("%s:%s Platform driver cnt:%d\n",
				__func__, smd_pkt_devp->ch_name,
				__func__, smd_pkt_devp->ch_name,
				smd_pkt_driverp->ref_cnt);
				smd_pkt_driverp->ref_cnt);
@@ -1036,8 +1038,11 @@ static void smd_pkt_remove_driver(struct smd_pkt_dev *smd_pkt_devp)
			break;
			break;
		}
		}
	}
	}
	if (!found_item)
		pr_err("%s:%s No item found in list.\n",
				__func__, smd_pkt_devp->ch_name);


	if (smd_pkt_driverp->ref_cnt == 0) {
	if (found_item && smd_pkt_driverp->ref_cnt == 0) {
		platform_driver_unregister(&smd_pkt_driverp->driver);
		platform_driver_unregister(&smd_pkt_driverp->driver);
		smd_pkt_driverp->driver.probe = NULL;
		smd_pkt_driverp->driver.probe = NULL;
		list_del(&smd_pkt_driverp->list);
		list_del(&smd_pkt_driverp->list);