Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1547010lqt; Sat, 8 Jun 2024 02:57:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVO6GMDhiessoeNTYE4sBo545ZVUTOJPOCq47upRuDkWs9obc+Av+TYCB0oQUarvSfqKlOfGDyjSRddSPy6FQhFo8QrAlnBnfwkYERR1g== X-Google-Smtp-Source: AGHT+IHlGebfMuOgDKcxEGyeKOGb7ekj488eVeDucXCyzcHcL8I1hwdeuSfUuamY+a6NrRRPojyK X-Received: by 2002:a17:906:3753:b0:a68:cd1b:5926 with SMTP id a640c23a62f3a-a6cd7891928mr322944966b.40.1717840655396; Sat, 08 Jun 2024 02:57:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717840655; cv=pass; d=google.com; s=arc-20160816; b=YdLCetqwD950YUvPEvy9jj58MAYplCf7z2KmzQBtQqjDftMA8R7UWo+dZI9t2RKyW6 nS2S7qbTYGzV6q28uvN3RmFAaAUx3wvyNW8OTsnjwo6CefHVR8YnpnlW16uLkGj3kQdr 7PID0w9WIUKAB52DfGzdZDXMXlVJTm0TozD0VzOitUweacsiKTG8DTjtP5+KBnjaKQgi nGLhTagB5d0dn6HR5K1MBlTTMZUPh46bpjjyvv++hDMSbrSGBRUTcdAiR1wJU1wiJmDC WFKuv8Axel7trBhqylp6LZoof2DqyDgkyxy7AlnxTVTpen68BP7ZcffblgydGfdki8sc snuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from; bh=BmznAWBsJqlRVG+BAi271N+FB+oNOUoeQw2Kujs1bs0=; fh=utfQjCkRahwr7cibaYmIJMwet5QEVICWGR1rhV9cjSw=; b=h9sRXhTJIREKym0lmtKQero8B92S6oGzTnF2Xx2JW9tVET1wc2J9r2ipuqxR3mZMIf YG3HtkZ+xDyHyNmB6FFeWzXbicPNKEc93ghAdnMrIjvMV2+nJN5HHNXf7KK58VOSbJQ9 sqN58M/Gn8t28MhCbGdNIAMqpNPPAJNweGEXGfG2NZP0aLvkAakeijO0XCpGpLRV8OiO htjdsiQTgUCk30TPfNxJBjqoWROClxm1I/qXISaOhCXPHK9VK4mLsax2SR8Zp8pX2Dqx mpTrTNA8nSfsKVOeV6dSIp9oNJzpwzB61O80xNglkQbN5EwVrBdDE3DubLLMYG42BxEG wU1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-207005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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-a6c806db038si276634166b.357.2024.06.08.02.57.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 02:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207005-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-207005-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 1F98D1F21FA3 for ; Sat, 8 Jun 2024 09:57:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6027B178364; Sat, 8 Jun 2024 09:57:28 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 6EE671779A4 for ; Sat, 8 Jun 2024 09:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717840647; cv=none; b=dLQ3fDe+B7QVb/Hx85rw1RpKeswageDDGL9z9KC8kve31rdqUyXO0ZuRX+UYFEarySBOcvB35eNt1VBw+lXR7I66+C/ohvYmcQ2SArqg/y4Qp9ITrEKkJhKwQDLNBFxgvgsZJMjkfB2pL0w7Og+P8w9eXu6hYVKnbJN8lwqySHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717840647; c=relaxed/simple; bh=QNr6XepZLJ1OumPJEZ6zp/XETbX9Dlf4CaIzjYktUqY=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kTLNJFYV9UY0C/ePvmQ7muScnASuwyggzeLJN/39Zw9erTovx7U8R9r1SM03SXO0TIOSq3aSHg0zBlij5/fS/T7mrqDAfo2OAhBJXMFP8Iab7WgXtYvB6Y7NqVAghHk6sVWpPnMUdZoJiz5nVGFCXrxMvF7uKu10QKwzZhiiD5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-230.elisa-laajakaista.fi [88.113.26.230]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 811b72ce-257d-11ef-ab0c-005056bdd08f; Sat, 08 Jun 2024 12:57:24 +0300 (EEST) From: Andy Shevchenko Date: Sat, 8 Jun 2024 12:57:23 +0300 To: Crescent Hsieh Cc: Jiri Slaby , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH 4/6] tty: serial: 8250: Add check for setting default serial interface Message-ID: References: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> <20240607114336.4496-5-crescentcy.hsieh@moxa.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240607114336.4496-5-crescentcy.hsieh@moxa.com> Fri, Jun 07, 2024 at 07:43:34PM +0800, Crescent Hsieh kirjoitti: > Moxa PCIe and Mini-PCIe boards are capable of switching the serial > interface through software control, while other PCI boards switch the > serial interface through hardware DIP switches. > > This patch adds a check while setting the default serial interface. ... > +static bool pci_moxa_is_pcie(unsigned short device) Please, avoid potential collisions in the namespace, i.e. start your function names with moxa, and not with pci. This can be amended once you split out 8250_moxa. > +{ > + if (device == PCI_DEVICE_ID_MOXA_CP102E || > + device == PCI_DEVICE_ID_MOXA_CP102EL || > + device == PCI_DEVICE_ID_MOXA_CP104EL_A || > + device == PCI_DEVICE_ID_MOXA_CP114EL || > + device == PCI_DEVICE_ID_MOXA_CP116E_A_A || > + device == PCI_DEVICE_ID_MOXA_CP116E_A_B || > + device == PCI_DEVICE_ID_MOXA_CP118EL_A || > + device == PCI_DEVICE_ID_MOXA_CP118E_A_I || > + device == PCI_DEVICE_ID_MOXA_CP132EL || > + device == PCI_DEVICE_ID_MOXA_CP134EL_A || > + device == PCI_DEVICE_ID_MOXA_CP138E_A || > + device == PCI_DEVICE_ID_MOXA_CP168EL_A) > + return true; > + > + return false; Hmm... First of all, can this be done by using pci_is_pcie()? Second, if the above is not sufficient, this can be read from driver data, no? > +} -- With Best Regards, Andy Shevchenko