Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2071544lqe; Tue, 9 Apr 2024 08:46:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVJFOr0e/LBY1h9dQDCuBTR2521ghc98rgVq93NyYuGh3Np/Yl1xtxqvP3mSzrHAI9FoYpxB7GHyvpBuoE1nPwG7Z5LVnbZIW5JIcXQQ== X-Google-Smtp-Source: AGHT+IEztTYJVGrVV5nRlq/9X15SDOE+Oo7tXdte9AG2nLdPzxBmBFrH1bJpWZjHRxB+4BCbKH4W X-Received: by 2002:a54:4401:0:b0:3c6:628:e8cd with SMTP id k1-20020a544401000000b003c60628e8cdmr873445oiw.11.1712677614267; Tue, 09 Apr 2024 08:46:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712677614; cv=pass; d=google.com; s=arc-20160816; b=UL9ZRpaBx1MrqzbHbX5hr7Q1qA4RAkvaB/ZmrBrOyOQBr1JKqCFUT0G1a4l+we/Xf1 LV49pDzV6i60wXyplm5V4RmkD9Y1JumefIZafB13w7sTcoB7gvndZbcecNf1CGlXyKTn yBN3ACknuS0aMbdX64Z+TgfriNh/KAe6WaF6mhtUspTEX6iu6LjoeG4bPa98mKOg5+Au mKYXAsLydiZwyPf5Xwed2um8ezuxagzbJEl9q4kV52RFSnG/fMSfaLJbgVC4BczrSjmj aCYavy/e4EKuGiUwS8ZJWg7yZJP/LKpRNr8M9g2rITjPiE+h7TsOYndZR/NmlGHg9pBo GiOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=tGKtNFefyyWSQPpVNbihtZ2oqv0OxBXwGK/JHuIWq3I=; fh=20gqxvyHjZZ75eSJUIPMr0SO0L1LwIEycDUU7zQh1ak=; b=BS1uQzL1v0+4Ym3JHVSxvxVmzcLm7BHsnZJd3xs3bqKmeZYBNixtpRwFvEmSPca15Q 9ckS5qdfnAiwarVfOjjDyV3ZdOmHb3s1CdyM4tVDSaHwj3fHw+1/9Uu5qmxCvITKVr02 8EvYgJX6qT1ZFAj9mIQQPyPWyXyfyLzuwAHsfV1Q4eYMJhNm5quFSLNGKGKiP++rPFSu GLJySXI1zRezoRRWp3CfZ6SQxjGlICyj6+tgI7T5oNVWQkWKE+msDZxoUwcQJy/7B2Zk 1XDanZMLizYHJ0obfYbEV6Wnltr2OdD99HBgD6tzpv4X6ihk/5krpXL8Rbf68AFPP1ux D7gw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=O5rq+CV4; arc=pass (i=1 spf=pass spfdomain=hugovil.com dkim=pass dkdomain=hugovil.com); spf=pass (google.com: domain of linux-kernel+bounces-137254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137254-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q19-20020a05622a031300b004347ae4c6c8si7188102qtw.373.2024.04.09.08.46.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:46:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=O5rq+CV4; arc=pass (i=1 spf=pass spfdomain=hugovil.com dkim=pass dkdomain=hugovil.com); spf=pass (google.com: domain of linux-kernel+bounces-137254-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137254-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E90541C20BB2 for ; Tue, 9 Apr 2024 15:46:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBDD713BC0E; Tue, 9 Apr 2024 15:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="O5rq+CV4" Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0254A13B7AB; Tue, 9 Apr 2024 15:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712677585; cv=none; b=tzUxciFA1/FpqVV6kDO3SCRtHYlZYDsjgu2BiMeA9b+s9IYnNRvlSDOufCOcJNbQzh94L7mYadYLGNMAbVVdo5C4iUoD1C/nzHrPSW1IXt1/sCuevZylKhIsow96lMVJj1vrzUMEFo6EYQoCn7qsWsjTBxAufHSckKtIkKV5q6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712677585; c=relaxed/simple; bh=lB+OSgFBKTPogjqBh7v/fFKKRZTQIHKNXmdDGgNyk8g=; h=From:To:Cc:Date:Message-Id:In-Reply-To:References:MIME-Version: Subject; b=JxzvDMMAXK0uLCtF6qQINoYJWNC/72l1MW5ddj45zSTEfr4t+EfSPHG9FGXPP5myxpV4qhyo2//OlK6gbmSUotwz8WifUoY63kganqSadldglXs4Tzo9/F6ga5kRX/ACtKzEFRpIVmTdzXMiVoOfMbN6Z8U6y/MMMYHOH7tRQwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=O5rq+CV4; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=tGKtNFefyyWSQPpVNbihtZ2oqv0OxBXwGK/JHuIWq3I=; b=O5rq+CV4kblEFvCwcvq5yv5BIf Kq2oduBDGzl2QaCxbD3I2XM/4aomdiFCwVsIe9wQnBCpWsRVKictO2+GeAolLhrUA4RuxBx10zA5/ 3Jd41XvMdrBsQtCQhmZtPG9QSI9J7EI/gjXTiceDE7fKI1cmrKwbMBvtREtSxwRL6KLE=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:44750 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1ruDfq-0002NM-Tk; Tue, 09 Apr 2024 11:46:15 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, peterz@infradead.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, andy.shevchenko@gmail.com, Hugo Villeneuve , Andy Shevchenko Date: Tue, 9 Apr 2024 11:42:50 -0400 Message-Id: <20240409154253.3043822-3-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240409154253.3043822-1-hugo@hugovil.com> References: <20240409154253.3043822-1-hugo@hugovil.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Subject: [PATCH v4 2/5] serial: sc16is7xx: unconditionally clear line bit in sc16is7xx_remove() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) From: Hugo Villeneuve There is no need to check for previous port registration in sc16is7xx_remove() because if sc16is7xx_probe() succeeded, we are guaranteed to have successfully registered both ports. We can thus unconditionally clear the line allocation bit in sc16is7xx_lines. Signed-off-by: Hugo Villeneuve Reviewed-by: Andy Shevchenko --- drivers/tty/serial/sc16is7xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 34edc80859d5c..b971fd2a9a77e 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1670,8 +1670,8 @@ static void sc16is7xx_remove(struct device *dev) for (i = 0; i < s->devtype->nr_uart; i++) { kthread_cancel_delayed_work_sync(&s->p[i].ms_work); - if (test_and_clear_bit(s->p[i].port.line, sc16is7xx_lines)) - uart_remove_one_port(&sc16is7xx_uart, &s->p[i].port); + clear_bit(s->p[i].port.line, sc16is7xx_lines); + uart_remove_one_port(&sc16is7xx_uart, &s->p[i].port); sc16is7xx_power(&s->p[i].port, 0); } -- 2.39.2