Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1239401lqb; Thu, 18 Apr 2024 04:32:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVh3SV+2I6SLxnqW1jrmHUnXFAzapuRECPSfCL8eMnPR+I848IhN40tWefiGi1ROu0aPNqRMEgS11KITQO/DgO9wbk97pXokqN+TMJ5aQ== X-Google-Smtp-Source: AGHT+IFFpTkRI/BRxMYTi0NuGLRe8xFTV26vZX3Nxc+Fb0pr0gH5r/Y/KFTdP5JSWy8tfSY9xkfj X-Received: by 2002:a05:6870:65a4:b0:22e:e1e5:b8d with SMTP id fp36-20020a05687065a400b0022ee1e50b8dmr3273413oab.51.1713439936386; Thu, 18 Apr 2024 04:32:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713439936; cv=pass; d=google.com; s=arc-20160816; b=j3XrS/Ay/IL/YYjdYbfCRBUy8aEI4DUQOY4gA6vzcH/dvzvoDHIBpe8oJJeRCyjgoj O3DtUsBGhGg1CbVH796GMcE+rbNwAAa6AiOc/rZ4GucHJ2zW8e1HZOCkAgprWl5igZ45 FMLPZmHTr4A0nyeA8VqIW8jlqwscc6HGuEoawi4vSBO1JLpShTVaD1SD4Ng6JafA3VOt BJWZpOu4EhlsFdMtrn5RYcWqeB+dh0AP6n4i5+B6EHmVFnigJnrDuYBi93lKoCh22ucb Abw0uCJPXdsKDGXf/tt8PD4CxNC95vmwbZ/lQT8tufy7kPSu4RGYACNEENBiw9LBTaQY ZWAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=QUJZZ6A6l5zi7BpDzNCkFviHhwh71nlQ9m8UysSfQ4M=; fh=guF8H1RoeP6GfOvCRP5XCy7toQePloxiU7KXyxTHOuI=; b=EyAg1wWmTc9CF/SNqe0pA+fCTdIzlz6QiuIDv5oGiloUmalGlxhoAn5uuPeOI09hyl c1d78zOXI/phyXYhHjifUPZHLq9ynLNatYKAotYZAWwbIzGv2oaXyUkg8FVBegDG6qdF RQdmlDCkl05Kwi4+53UuHJGEGBGtxkNgVxnRKwUDIiOJ8AK0zoIUtYfkeeqQcN4rmRjd X5Q/DVoON/uT5S68qDUQ9AW2EvKFrZfSdn5RUjEQp7NWZoLmfLC5zOcFzGXY37enzcRK Kiuoi7cWZKwEWF3bj25AUQDEGIzaU7FRi16ntlAC/aU+w93vF7ovULkU1vPJjL7cqC4u PEog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ekomtfTr; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-149970-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149970-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t5-20020a634605000000b005dcbb6b06bbsi1203340pga.292.2024.04.18.04.32.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149970-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ekomtfTr; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-149970-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149970-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 03A262844BD for ; Thu, 18 Apr 2024 11:32:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D1E015E7F5; Thu, 18 Apr 2024 11:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ekomtfTr" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 7D90215E5DB; Thu, 18 Apr 2024 11:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713439929; cv=none; b=DpXagm7kQKgxvzwI+YRypgMVr1eotDnSPYs9f8zj5g1kkN+luEQXq2OVPEr52CRg7WxQyrEqQLPLOD8fofHzoi3ZKwjvITBH+3ZhWxN95Pcq8XPiU8qWSpA1z8BN0THOWxp1GaITurwW/7Y/Q/RAfCw9xo7Nfh+tNdgVwekrvso= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713439929; c=relaxed/simple; bh=HQxeyED3Z82cVQSD6uzhUbrNuIaqk/Ru44l/pAWP8c8=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=c542XH++t1NBWXltk3cWrjj7Zhq2EeGlZGtma1eP+7s9MkmCifskNpZ2AOvE94e4nFRMLSiViCf8efA2Zvf1aUQXoEIjjOdnsni2RycsdKHleTtLouTAggSsSFyfNPJR+R3+V8n1JYwS7aYbYS3desRWuoOQYeYbnqxcIEHPb34= 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=ekomtfTr; arc=none smtp.client-ip=198.175.65.17 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=1713439928; x=1744975928; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=HQxeyED3Z82cVQSD6uzhUbrNuIaqk/Ru44l/pAWP8c8=; b=ekomtfTrSueymx/j0rETIzrUqJi/FaEZiDnhBPfEIbewjao0spdUrCBC BiKT/YYM4XMwub/qUyPBOqg4pKmg9tVOxtfQmbH/JIM6u6iMIhPq5tl8A dX3EymqyhWC72aHj3Lan2q7EZw1jcdedIP04YVAjXpvfuTSR6+hwDRAHY w7I1TEkSauFugfu3t/+60czCl8XHVMgtkUu6Td/TSb87xlUyof5U4ILgb sRhWO5A2rJHO+BZWz4oM/wcyK4mybl3ntKDAiWTKyO7qSi5J8Q/bqVYkb TIVxFcmw4rP1Ul/Uw+Xge1fj0dA7XuCKoyq6oeMdiXIWi2rS0UoDGso2v Q==; X-CSE-ConnectionGUID: 5S9PyJZ0Tr2AmCu7viEtqQ== X-CSE-MsgGUID: sDArExs7TPy2Q/+TQvkXOg== X-IronPort-AV: E=McAfee;i="6600,9927,11047"; a="9098737" X-IronPort-AV: E=Sophos;i="6.07,212,1708416000"; d="scan'208";a="9098737" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 04:32:08 -0700 X-CSE-ConnectionGUID: tnh4fF/PR2q00vnd2tmwrA== X-CSE-MsgGUID: kd/VHbO+TwCHHg/mNJKX/g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,212,1708416000"; d="scan'208";a="23013166" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.36]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 04:32:06 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Thu, 18 Apr 2024 14:32:01 +0300 (EEST) To: Parker Newman cc: Greg Kroah-Hartman , Jiri Slaby , LKML , linux-serial , Parker Newman Subject: Re: [PATCH v4 2/7] serial: exar: added a exar_get_nr_ports function In-Reply-To: <33f2bf66bc334573c10cf670a299ecef0b7264bc.1713382717.git.pnewman@connecttech.com> Message-ID: References: <33f2bf66bc334573c10cf670a299ecef0b7264bc.1713382717.git.pnewman@connecttech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323328-1371258394-1713439921=:986" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1371258394-1713439921=:986 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 17 Apr 2024, Parker Newman wrote: > From: Parker Newman >=20 > Moved code for getting number of ports from exar_pci_probe() to a > separate exar_get_nr_ports() function. CTI specific code will be added > in another patch in this series. >=20 > Signed-off-by: Parker Newman > --- > Changes in v3: > - Only moved existing code in this patch, will add CTI code in subsequent > patch >=20 > drivers/tty/serial/8250/8250_exar.c | 27 +++++++++++++++++++++------ > 1 file changed, 21 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/825= 0/8250_exar.c > index 04ce5e8ddb24..72385c7d2eda 100644 > --- a/drivers/tty/serial/8250/8250_exar.c > +++ b/drivers/tty/serial/8250/8250_exar.c > @@ -704,6 +704,21 @@ static irqreturn_t exar_misc_handler(int irq, void *= data) > =09return IRQ_HANDLED; > } >=20 > +static unsigned int exar_get_nr_ports(struct exar8250_board *board, > +=09=09=09=09=09struct pci_dev *pcidev) > +{ > +=09unsigned int nr_ports =3D 0; It's always set, so no need to initialize. > +=09if (pcidev->vendor =3D=3D PCI_VENDOR_ID_ACCESSIO) > +=09=09nr_ports =3D BIT(((pcidev->device & 0x38) >> 3) - 1); > +=09else if (board->num_ports) > +=09=09nr_ports =3D board->num_ports; > +=09else > +=09=09nr_ports =3D pcidev->device & 0x0f; > + > +=09return nr_ports; > +} > + > static int > exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) > { > @@ -723,12 +738,12 @@ exar_pci_probe(struct pci_dev *pcidev, const struct= pci_device_id *ent) >=20 > =09maxnr =3D pci_resource_len(pcidev, bar) >> (board->reg_shift + 3); >=20 > -=09if (pcidev->vendor =3D=3D PCI_VENDOR_ID_ACCESSIO) > -=09=09nr_ports =3D BIT(((pcidev->device & 0x38) >> 3) - 1); > -=09else if (board->num_ports) > -=09=09nr_ports =3D board->num_ports; > -=09else > -=09=09nr_ports =3D pcidev->device & 0x0f; > +=09nr_ports =3D exar_get_nr_ports(board, pcidev); > +=09if (nr_ports =3D=3D 0) { > +=09=09dev_err_probe(&pcidev->dev, -ENODEV, > +=09=09=09=09"failed to get number of ports\n"); > +=09=09return -ENODEV; =09=09return dev_err_probe(&pcidev->dev, -ENODEV, =09=09=09=09 "failed to get number of ports\n"); Other than those two small things, Reviewed-by: Ilpo J=E4rvinen --=20 i. --8323328-1371258394-1713439921=:986--