Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4228835rba; Tue, 2 Apr 2024 10:45:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+pnKpQmsUBNiaQJyyISvtV3wvaAtVt7Yrq3co0rwZ6AeGyrqoU/k1IUjfIYzzw4woi6iBN0nvT9pfuZLHOv+jOX5uohhItHW9FJoT5Q== X-Google-Smtp-Source: AGHT+IFwK35ERAdLARCVvmTVmG0oaKMGsOjXTM748pNOOsjvzfIBEFjQMLiWWZ8egxHAt4TgeC+J X-Received: by 2002:a05:6a00:1490:b0:6ea:c3bc:2031 with SMTP id v16-20020a056a00149000b006eac3bc2031mr14806291pfu.7.1712079916072; Tue, 02 Apr 2024 10:45:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712079916; cv=pass; d=google.com; s=arc-20160816; b=mE6AwoqrnGzbOulNc8/g/d6K1WAhmNLEwpq+TYFI4CxN4PEEghF1qCinhTMsiRA9Cn 642OwSmt2riXkTAPiehrjBPEFeys7gul+AEQeN6OLYKMl5i4Vt3MAyCdK2nC8SlfkErA bzVgsGxhpnlZndq4blHhY9njCV4jwLh7aT3pNUkGbqL36myOFHtSkRWh+P8KCgWlrpvO W6MR1zQWSZPlPW8qpcu+q+mIpI3GIclKVrc0HIZ+kX85XAgSr2PjzEh1QqltGvMBrYgG /b/jYavD/gniUn37DKwmFjB6EU+f0mZJubFnMxlO1Au8lDZ0F8U4uhq9exnBZiYhHyBn L2SQ== 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=ad0gcdFGze3oGsd4w0exnPgF1rQ7pt35UpkWIgdhFkE=; fh=fZm+o0eQwFQ40Rv6GBvAPvFKhvGGLg2dIl/YeDdOBEY=; b=WzLYDzv0c8RK9Pz6yCbIIjZNbrCZZaUubIKqfqD342nLPc/4s43y2ev4c6mt61FvLV o1q5Ik3Ci8o2QNMyeQnOJ4/g2A96fe+PlFNnGJguyDHJkY/tkmqEbmM0Azo8I7fS8kUY iJ5+Vmzz7TurmfjAB2TY+8D/p3AkE+TRxEEslCstWFZhuEo49Oy1fkzHAr9/Yrs0kSBg bNnJVk13gLx81OOpyW0Af4U+b9W08UiAAzXe4hM7zlvxFv94DLGdOmnXdTN9GAVoY0vO /L5fYyDE6omEIT24p54tfBKqXWlBpwUtEHKaL6PII1TujMZlVZvHQ7ERkCof6JrYuy1l j8OQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=LGZPGp0s; arc=pass (i=1 spf=pass spfdomain=hugovil.com dkim=pass dkdomain=hugovil.com); spf=pass (google.com: domain of linux-kernel+bounces-128447-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128447-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i185-20020a6387c2000000b005d47eca0246si11440645pge.378.2024.04.02.10.45.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 10:45:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128447-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=LGZPGp0s; arc=pass (i=1 spf=pass spfdomain=hugovil.com dkim=pass dkdomain=hugovil.com); spf=pass (google.com: domain of linux-kernel+bounces-128447-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128447-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E4D7281F17 for ; Tue, 2 Apr 2024 17:45:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6721315AAC0; Tue, 2 Apr 2024 17:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="LGZPGp0s" 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 CE7845EE78; Tue, 2 Apr 2024 17:45:04 +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=1712079906; cv=none; b=h6xe/a4Mzqzf1VQ3cEmeiNLRuOdqa32lY9QixBd5/fM1TivNWl2PDKgaJZMkNoyfy44laGkP1n+67Ri4bzso8p1RZbbJCxH4cidGIZrjhB/jQH51Is4TCZQbaURGt3J5x0dk20tzrITHEbyuztg7kfM6XNs7sRQFx6pHQmd1Dh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712079906; c=relaxed/simple; bh=m9+96oagLQ30ESL2YYZeapo9L0snt63O3ucrZgIsfz0=; h=From:To:Cc:Date:Message-Id:In-Reply-To:References:MIME-Version: Subject; b=WW/Jso4WeKcicomtml+QYjSXj7CkNJYK5R1WZmgmrqmnPtXo1oz6qKnrQwqr2/Yn+3pDxyFASRoix/pDkKS6XWfgZBQLh2uLM5SS6oFeh41HCWJQSwuHRG/i+BX3SMBVacRJz9R/DALD5mCBSE4BjU56PSCNBLMJcRy+L9/C3rg= 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=LGZPGp0s; 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=ad0gcdFGze3oGsd4w0exnPgF1rQ7pt35UpkWIgdhFkE=; b=LGZPGp0sKZMPlcSZglj+esh7iw ikvO5nE5UEhyO2qadCol94pf31j2/LSX7bsrghW80mbMBROuahyYV0F+T3JeptNiFYfFt0fBk+36S flTzZYXrlEhT1RJwwZL+WsFJgqUBbsVdxzv6RLpZvdjtEMzO68X8hVSTIEc5FD7NktVw=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:56268 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rriBy-0008FF-VI; Tue, 02 Apr 2024 13:45:03 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, andy.shevchenko@gmail.com, Hugo Villeneuve Date: Tue, 2 Apr 2024 13:43:49 -0400 Message-Id: <20240402174353.256627-2-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240402174353.256627-1-hugo@hugovil.com> References: <20240402174353.256627-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 v3 1/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 --- 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 929206a9a6e11..eec6fa8b0da79 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