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

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

Merge "TTY: msm_smd_tty: Add warning to driver removal function"

parents bcd807f1 2cad996e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -492,6 +492,7 @@ exit:
static void smd_tty_remove_driver(struct smd_tty_info *info)
{
	struct smd_tty_pfdriver *smd_tty_pfdriverp;
	bool found_item = false;

	if (!info) {
		pr_err("%s on a NULL device\n", __func__);
@@ -504,6 +505,7 @@ static void smd_tty_remove_driver(struct smd_tty_info *info)
	list_for_each_entry(smd_tty_pfdriverp, &smd_tty_pfdriver_list, list) {
		if (!strcmp(smd_tty_pfdriverp->driver.driver.name,
					info->ch_name)) {
			found_item = true;
			SMD_TTY_INFO("%s:%s Platform driver cnt:%d\n",
				__func__, info->ch_name,
				smd_tty_pfdriverp->ref_cnt);
@@ -514,8 +516,11 @@ static void smd_tty_remove_driver(struct smd_tty_info *info)
			break;
		}
	}
	if (!found_item)
		SMD_TTY_ERR("%s:%s No item found in list.\n",
			__func__, info->ch_name);

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