Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp581551lqt; Thu, 6 Jun 2024 11:49:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCxjP3dPFkAQJTB5kOJL0Yx3YxLgne8tig4BboagBcG5gFx6QjJ4r7X/ElophocLIdle1mPKmXDKvVtN1c3DDISGNvtKruKDXMs2XLeQ== X-Google-Smtp-Source: AGHT+IEdPSF4blbgyI8TnoOq5IwkmlKfB/jmUPQRiplZcz3bKGQrXD986DXy/UvvRBSj4P8nILnB X-Received: by 2002:a17:906:5fce:b0:a68:fbdb:728c with SMTP id a640c23a62f3a-a6cd665b1eamr28220866b.21.1717699785732; Thu, 06 Jun 2024 11:49:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717699785; cv=pass; d=google.com; s=arc-20160816; b=n1JET5XM29VIrt/2Uk3DRHOzFR4o6m5z5Ce8gH80pIMFYRzP4o2O5KD7NafeFaFag7 m8iNj5zvs3c7eTpA6buyE1cxNxtX1nDJ+hrkKoFq+KpR4Vjg0o6qTET/tFPhXzjXa6rt 0Ud27v2pUjoqNhdsH0eASCK1YjdxponF5fxCgArHj6bzNTsnxmZmprcow9nJhxIAwlMy 9EltNYcKQx38EnOeoRfeMY6f9ziabJ3xArb/QUZycMfwLW5P2wRv+8Ji2KvoqxRf0qDt dYmH8phkSDa1WbYq3fHz6b7WN5brpor+dj6t7Ju/mygV6Z72Pgw3nnDNUjMm1TdHFgee SZGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=5UhBuqNA8RiCwPvSCQxRqEtKQaRkToYFKf4F1dUBLAU=; fh=ZS9YJfguNAznzMT0iCHuhiso0OI1aLtyPzkhTnDvnH0=; b=TnR1wKQ5X5BFKihTcw1n2uvBh1RQGmnr/fGSG1qSQoaUHCQDALyN5//y+gpXAFI96V QuuUROxWjvfMoq9dghMErmfTZtvz88gdjmaVIXWLSEzE4cu3NyR1oyfbKRkvAHQ3b0ma BM3D2769UvzhI0Avep5MiCFFCczFyPQHhxN148hicC80vDO0oWxjCztyxdJ1gc9dVp81 uLcl7PTadoOMypDoDZwJ22hFlTA6eIVZ6raVO0jtaXoCcWohdyWTKhLBtt4LzKnT+lz3 rzvnjzeAqbp0j2OqA7yioQmOhgKtXfkh/Q33LrSuLfhifk4mSJDiPIvp+wa26OzmPhpP 8aTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="D6hQ/cSa"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-204917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c806d81adsi99095566b.314.2024.06.06.11.49.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 11:49:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="D6hQ/cSa"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-204917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 842601F236E6 for ; Thu, 6 Jun 2024 18:49:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7C1F54654; Thu, 6 Jun 2024 18:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D6hQ/cSa" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 02C1C4652D; Thu, 6 Jun 2024 18:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717699728; cv=none; b=k/KL/bqIVuFwMhjrd3Jf9OlXq7bVI/aGdeQfv2nVIfXNFv1fu6JT4xO8QMBNs4xjSQ4LrU6lJL3lzQ+7Q7P4HzK7SOvvhKnVzUuAfOc/rqErmij8kzX25tFALGLifL7eAwDoaLMH+Yq9WqlKG8p9yUXWZWAMN76o5zP2Yyc5NT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717699728; c=relaxed/simple; bh=f+7fBhtcJlXgCJbJkgh56o4Pav2IO44UtKl6YoXUVAs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HDctpB+PZvF92UUcGL4cQTSum8X9GE7peagHZSyBzj5YNHtp1Isi2eKmy+7XK89jDgAl/EXnSWkyo6Ev5pitTf4BAfksr7B7S30NgfX0l5hEssx74HwZyFbvm313ghtmCsIsUepC6WqaDd8BnWG9IruHgLf6YWSCO9XtBk39708= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=D6hQ/cSa; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717699727; x=1749235727; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=f+7fBhtcJlXgCJbJkgh56o4Pav2IO44UtKl6YoXUVAs=; b=D6hQ/cSaF576EwugZKO76pY9mRN5ovVSFudaELQwI6AACHci6NiT/8iT b+OliaRJuy12CxYuGxDezEX+DyuQt1tfBkyfug6ui9uPIQfzUYGPhYMg+ Tdl72/8epCoxijMT15uXVoHow+zAepExVc/QKzaLCv0oNYy200wqBMYw0 s8SOpPrNMH7IkKOY/BTz+ZTkbQ0Vf9rs9fr37kzB/gN6fkRYC7E9EBtYD bpxeXS+yw8OPAWrHy0WwIrgASNiGKI91UPy6xzKhIjputj9DxsJzxDmM0 vC+skY2LY1GzJb2qMSH7BzUa/Pp+dkCz9bu0Q4OiVP2lYfQWBdAl0oEXn w==; X-CSE-ConnectionGUID: v99+iC7LQoy1GLxKjh59Kg== X-CSE-MsgGUID: CGs3sbFUTzqy7UIBYs3aWA== X-IronPort-AV: E=McAfee;i="6600,9927,11095"; a="14548043" X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="14548043" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 11:48:46 -0700 X-CSE-ConnectionGUID: RumPFe7yROqUFc9Uinxspg== X-CSE-MsgGUID: zxQRNvS9Tc6m0XeCeGiL2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="38179579" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa009.fm.intel.com with ESMTP; 06 Jun 2024 11:48:45 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id BC2621C9; Thu, 06 Jun 2024 21:48:43 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v1 1/1] serial: 8250_platform: Explicitly show we initialise ISA ports only once Date: Thu, 6 Jun 2024 21:48:41 +0300 Message-ID: <20240606184841.3102545-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit serial8250_isa_init_ports() uses home grown approach to make itself a singleton. Instead, explicitly show that we initialise ISA ports once by providing a helper function which calls the original function via DO_ONCE() macro. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_platform.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8250/8250_platform.c index ded985182e04..5817c1d72314 100644 --- a/drivers/tty/serial/8250/8250_platform.c +++ b/drivers/tty/serial/8250/8250_platform.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -53,15 +54,10 @@ void serial8250_set_isa_configurator(serial8250_isa_config_fn v) } EXPORT_SYMBOL(serial8250_set_isa_configurator); -void __init serial8250_isa_init_ports(void) +static void __init __serial8250_isa_init_ports(void) { - static int first = 1; int i, irqflag = 0; - if (!first) - return; - first = 0; - if (nr_uarts > UART_NR) nr_uarts = UART_NR; @@ -102,6 +98,11 @@ void __init serial8250_isa_init_ports(void) } } +void __init serial8250_isa_init_ports(void) +{ + DO_ONCE(__serial8250_isa_init_ports); +} + /* * Register a set of serial devices attached to a platform device. The * list is terminated with a zero flags entry, which means we expect -- 2.43.0.rc1.1336.g36b5255a03ac