From patchwork Fri May 3 17:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794598 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 DC3D81581EB; Fri, 3 May 2024 17:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756783; cv=none; b=r9HX7Uvsh/jWVtgupKwIEmE9OakDWQbgGZcxaugeHmabyc+ea1XqNmJzH/fPxeEuDxN4zXaHtoFG85k6p9veLCt3LAcetjmOreZinrLdGEqI4jQqu3IQSmP37baCiDC+mTxpZjNBDQJvvrcItyaEkfjH2opyMBPc1/wfcrFUqpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756783; c=relaxed/simple; bh=t4GElT9Cf8GLEDUkp9KzuLxTLCrrLC4H8X0vZ1KYv78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MDvaYLSVTug+6cf7SKlW0I9jj59lptWpajmYdv6az3guqePHxBv0pGUwLGP27gtZEQ8qJMNeNIb7TNZi/UvKJlWFpQ8EH7yYUpx8MPQk5eYSp8suF8AVR2oBmVwAIy97bqF0WN2hRiEExI1wkQjncrFH7pWn0C/1Sh7eFIc5Jo8= 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=d7IQmpPs; arc=none smtp.client-ip=192.198.163.16 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="d7IQmpPs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756782; x=1746292782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t4GElT9Cf8GLEDUkp9KzuLxTLCrrLC4H8X0vZ1KYv78=; b=d7IQmpPslcvvXo0vYVMNLgeNPU9kBt7euWq9mTeK/ivSMS3/ms8GO957 UXLcCo8CsNlABKnAMe7aekn9HYzx7RvJjDz4GsILbSRpsR5wCm0Fs2Qc6 yPnulybf7DPIgzbqcfpsL6YArsEmnxjAMudyG8ot92zDBs1hIaiAABl8p N+2Zim1St0KsHR6iWNAskcUlXtreF39cLuCFZcFScVPPeRUbN9vRN8Sbb 2S2BsJJmdadAG3LgN5xgcqbQs5TehdzGtHM8Lj7zKiJZ/edfv073PLatj Jfih3KVn5XWSnZEtADsCyDc0kvBbKG4P6/VgVPjIxu8GRwAKgLxC0OVsJ w==; X-CSE-ConnectionGUID: kP+OifPvQISDihM85cjL9g== X-CSE-MsgGUID: 06QmPl+rSdy0iNW9YbLC2Q== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="11107794" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="11107794" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:41 -0700 X-CSE-ConnectionGUID: 7aRZWgPJQO2+ptUny/k7Kw== X-CSE-MsgGUID: TPmb+KzUSbK2l2j3IZa/jA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="58415412" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 03 May 2024 10:19:39 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2A66093; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 01/13] serial: 8250_exar: Don't return positive values as error codes Date: Fri, 3 May 2024 20:15:53 +0300 Message-ID: <20240503171917.2921250-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 PCI core may return positive codes for the specific errors. There is a special API to convert them to negative stanrard ones. Use that API to avoid returning positive values as error codes. Fixes: f7ce07062988 ("serial: exar: add CTI specific setup code") Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 5e42558cbb01..9930668610ca 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -1162,12 +1162,12 @@ static int cti_board_init_fpga(struct exar8250 *priv, struct pci_dev *pcidev) // Enable external interrupts in special cfg space register ret = pci_read_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, &cfg_val); if (ret) - return ret; + return pcibios_err_to_errno(ret); cfg_val |= CTI_FPGA_CFG_INT_EN_EXT_BIT; ret = pci_write_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, cfg_val); if (ret) - return ret; + return pcibios_err_to_errno(ret); // RS485 gate needs to be enabled; otherwise RTS/CTS will not work exar_write_reg(priv, CTI_FPGA_RS485_IO_REG, 0x01); From patchwork Fri May 3 17:15:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794597 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 6D2C2157E7D; Fri, 3 May 2024 17:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756784; cv=none; b=clWYysruTJRmRRkhxvokykliNoF/G+63/wR8iHeZGLdHNJ8XQpBt1i0pN4a2Ct34fsZ2NwwTLTV4EvWxI6RLMbmFkLSIyRMv8y+Ki/AOMKRcVvEhiWI9TeyEVuOvHdGkwqeDjM+d0EOi4vL9BY4okxrgxolJQgRjKBKAKa6LcMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756784; c=relaxed/simple; bh=gwi0Y1q+5n0D0n3Bzr328+LnxrPKT8VdPbVuxfggMIE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Guk/1U5hdT+ka89n2XM1O8JsbQms2UZEPWH1Vqyf0ygQL41zOqEH56kjrPVzgBoXqy0kTJX9I4f3ugONb8PdsIdh+1PsisePQmW+/hSmS0srn5GsLYyYZST+WlvasXSbcvJwugPvYdWPBz8znytc58+tMs5Artj4HmPeTD54c9s= 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=SIH++ql5; arc=none smtp.client-ip=192.198.163.16 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SIH++ql5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756783; x=1746292783; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gwi0Y1q+5n0D0n3Bzr328+LnxrPKT8VdPbVuxfggMIE=; b=SIH++ql5NCj0Apw62HUP9tvFGjrozyc79XR6q6gRxd9ewxmi3JGOWEQX prdrapzg6P0S3m+n9QENNH8xp+Dft9fs6rwIN4qmtM4178EhIvBfvSDF0 GHvjjfEsPeNDtabyfYbEpqc3fZg27bXXfDVa/C9p5zyHkUHaq68lrHr3L 1bchKQysrsR67GKZuuMLQUXfhsBOIlIxIn/EIAGHvYkqTT9wwWv/8rwfy eXtlXdUTXx7/Y5269c0CEGqNJRv5PFi3AFF1ZYrA7R42Oef+9xEtqdNnZ NL1FEdv7563MTZhCp3niCwsvmBXFG7EzkJmcbINf7pVfPX9HJUMr4jmtq Q==; X-CSE-ConnectionGUID: C0F9Cu5nTmuEpBaQd5BA0Q== X-CSE-MsgGUID: klyF8XKSRjSHE5WatV6Cpw== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="11107798" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="11107798" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:41 -0700 X-CSE-ConnectionGUID: OJhCfnmTTYG9CzazOSfQoA== X-CSE-MsgGUID: TjjpVU++T9iEpXUJe3DW8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="58415415" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 03 May 2024 10:19:39 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3709A366; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 02/13] serial: 8250_exar: Describe all parameters in kernel doc Date: Fri, 3 May 2024 20:15:54 +0300 Message-ID: <20240503171917.2921250-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Kernel doc validator is not happy: warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_xr17c15x_xr17v25x' warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_fpga' warning: Function parameter or struct member 'pcidev' not described in 'cti_get_port_type_xr17v35x' Add missed descriptions. Fixes: f7ce07062988 ("serial: exar: add CTI specific setup code") Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 9930668610ca..150c4abd92fc 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -715,6 +715,7 @@ static int cti_read_osc_freq(struct exar8250 *priv, u8 eeprom_offset) /** * cti_get_port_type_xr17c15x_xr17v25x() - Get port type of xr17c15x/xr17v25x * @priv: Device's private structure + * @pcidev: Pointer to the PCI device for this port * @port_num: Port to get type of * * CTI xr17c15x and xr17v25x based cards port types are based on PCI IDs. @@ -807,6 +808,7 @@ static enum cti_port_type cti_get_port_type_xr17c15x_xr17v25x(struct exar8250 *p /** * cti_get_port_type_fpga() - Get the port type of a CTI FPGA card * @priv: Device's private structure + * @pcidev: Pointer to the PCI device for this port * @port_num: Port to get type of * * FPGA based cards port types are based on PCI IDs. @@ -836,6 +838,7 @@ static enum cti_port_type cti_get_port_type_fpga(struct exar8250 *priv, /** * cti_get_port_type_xr17v35x() - Read port type from the EEPROM * @priv: Device's private structure + * @pcidev: Pointer to the PCI device for this port * @port_num: port offset * * CTI XR17V35X based cards have the port types stored in the EEPROM. From patchwork Fri May 3 17:15:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794819 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 0CA3C1581EE; Fri, 3 May 2024 17:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756783; cv=none; b=fEi3sNmLT6jh77R5IO93zRp+VB6T4as6kfaHh6aDZMiovF8oAXVhi/7QHMFw6EYd0MaL6YlfhBV0aYx5/wMpQmJoyJAHPRcyIwJ+b5uc+wI8I5wPwdN17vqOylEz5HbtjoTGA7Nyg3l1zonx+eCcxQ/wrij1OkdxVubCmLCgPgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756783; c=relaxed/simple; bh=MNevgiHkmuCG//FLCxCfm2v7RKLaRbqWb2DHuURYI4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f9oAqfTs4UQM1ZpsLtyc/Z6JppwrQ5t2ZQHOILT7ECeRbxjuOa790z/8NPpzjVaGDg1SDHxVbQxfxQd4xtUsiGnrtWnr0GHnHrhsEXjBrQL6sJQE7wM3mbR/ZfgIwDbjqhkrVvEtyMuySkcSI6KRq5G3r59zzym+BvDmYyKri0g= 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=LdESeW/n; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LdESeW/n" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756782; x=1746292782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MNevgiHkmuCG//FLCxCfm2v7RKLaRbqWb2DHuURYI4c=; b=LdESeW/nv3E5rF/lEJK3d4IcayMb/gwdRZ4h0jZe8XTtdZpfwK/rD5/n 4tt+TM8xGRcn+tpS7FjCU/JH9sj2AqYVkGArFxaGgYgnaU7sl5SW/ph3b dxsYY6kirX7eUj7p/BKF7HN9vN6SGv8xkqe+v2QIaxCc35VyoiHIInuYA c9UtoKCx0K1/KW6wdcEMlKL6ajezxHsLgpVRM6vWhISShKZJ3VdoRAqBC 0nlkkreAyN6H6sCCz6qYAPYPyH4odeBP35WZF7kcamPZpX+s6rqEJdDnr zNTcd+spPjlkejYWVsPRlvSgxBWMlXb+YFRpwd/D4rDjkv/UL1aElGaNS A==; X-CSE-ConnectionGUID: PHivvf0+S5a6YKljexG3bw== X-CSE-MsgGUID: w94ld1jvQYK4GdEgWqiuXg== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="35962093" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="35962093" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:41 -0700 X-CSE-ConnectionGUID: OqMjfBsQRW6s3Wvj07tMpA== X-CSE-MsgGUID: kZDOZ3wlSXG+rRODBPqrrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="28098200" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 03 May 2024 10:19:39 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4408540F; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 03/13] serial: 8250_exar: Kill CTI_PCI_DEVICE() Date: Fri, 3 May 2024 20:15:55 +0300 Message-ID: <20240503171917.2921250-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The CTI_PCI_DEVICE() duplicates EXAR_DEVICE(). Kill the former. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 150c4abd92fc..ab0abc14ecf8 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -1737,7 +1737,6 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { .exit = pci_xr17v35x_exit, }; -// For Connect Tech cards with Exar vendor/device PCI IDs #define CTI_EXAR_DEVICE(devid, bd) { \ PCI_DEVICE_SUB( \ PCI_VENDOR_ID_EXAR, \ @@ -1747,16 +1746,6 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { (kernel_ulong_t)&bd \ } -// For Connect Tech cards with Connect Tech vendor/device PCI IDs (FPGA based) -#define CTI_PCI_DEVICE(devid, bd) { \ - PCI_DEVICE_SUB( \ - PCI_VENDOR_ID_CONNECT_TECH, \ - PCI_DEVICE_ID_CONNECT_TECH_PCI_##devid, \ - PCI_ANY_ID, \ - PCI_ANY_ID), 0, 0, \ - (kernel_ulong_t)&bd \ - } - #define EXAR_DEVICE(vend, devid, bd) { PCI_DEVICE_DATA(vend, devid, &bd) } #define IBM_DEVICE(devid, sdevid, bd) { \ @@ -1786,6 +1775,7 @@ static const struct pci_device_id exar_pci_tbl[] = { EXAR_DEVICE(ACCESSIO, COM_4SM, pbn_exar_XR17C15x), EXAR_DEVICE(ACCESSIO, COM_8SM, pbn_exar_XR17C15x), + /* Connect Tech cards with Exar vendor/device PCI IDs */ CTI_EXAR_DEVICE(XR17C152, pbn_cti_xr17c15x), CTI_EXAR_DEVICE(XR17C154, pbn_cti_xr17c15x), CTI_EXAR_DEVICE(XR17C158, pbn_cti_xr17c15x), @@ -1798,9 +1788,10 @@ static const struct pci_device_id exar_pci_tbl[] = { CTI_EXAR_DEVICE(XR17V354, pbn_cti_xr17v35x), CTI_EXAR_DEVICE(XR17V358, pbn_cti_xr17v35x), - CTI_PCI_DEVICE(XR79X_12_XIG00X, pbn_cti_fpga), - CTI_PCI_DEVICE(XR79X_12_XIG01X, pbn_cti_fpga), - CTI_PCI_DEVICE(XR79X_16, pbn_cti_fpga), + /* Connect Tech cards with Connect Tech vendor/device PCI IDs (FPGA based) */ + EXAR_DEVICE(CONNECT_TECH, PCI_XR79X_12_XIG00X, pbn_cti_fpga), + EXAR_DEVICE(CONNECT_TECH, PCI_XR79X_12_XIG01X, pbn_cti_fpga), + EXAR_DEVICE(CONNECT_TECH, PCI_XR79X_16, pbn_cti_fpga), IBM_DEVICE(XR17C152, SATURN_SERIAL_ONE_PORT, pbn_exar_ibm_saturn), From patchwork Fri May 3 17:15:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794818 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 9E2661581FB; Fri, 3 May 2024 17:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756785; cv=none; b=Pks86IWBN+jSGxxhp3610Z+j3/hdP1znYCpLLQk8e+JceTjZaNg/29Mv8e2SbCTYwUSm2qRA134mMXpu0AjZCTLyMecSe/ySIFRrwSvmUawDNaKKjsVWfTLsvMs1XHnTUvz3cy323IF1JgHc+kewXiuOuiEjuX/b9FR4i1OOeF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756785; c=relaxed/simple; bh=0VpPJMdPe+aSRC95rZ8nfI5XtCmL1qQshMgBSd3OLKA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NtGPzS+y/OKQI4xKq+uEKHpC1wtv/58GtlXmwRxJskITIGN5duik7XiD79t0HSj5DYFKMH14lK5RoBc/2fADm8tOxlD9NXvXOeO2fb2bJzNQrMnjGchyHhCcq/Do5A39soW9qdodgqvGku5r/KlVy3iyVGv2f3I+I6eMtPYtOaE= 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=Y37oYTX0; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Y37oYTX0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756784; x=1746292784; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0VpPJMdPe+aSRC95rZ8nfI5XtCmL1qQshMgBSd3OLKA=; b=Y37oYTX0L5d+QYVQspM3YEfawBKWBHcaWOXPxK/5/zQZIEM3svxUoxw2 AoSQ1rfF3Jli0y5bdmIba+dhitVszyucwxg1vznllL9v/RXL71fzANP4E lwmBOtDYObsjuSiiFNtNRGtydBWairhaORi1dt/wW7jiM+wv58kdzykrh 3LlrPi6SHfiUhudiniyI7gnU6m0mFNG5URm/cQIPkrve5+hWfHzjhscj7 3KwyscYMFwEufi2ekhYL60ckfUUKAJmBtJ0qsWw8aLqMy42iWjThsXKa0 4/sxK+gM7k1V3sLG+UsRbmfoRHgQJ/vx4P6c0Ah9jpMbzRcAQBZo/y0ft g==; X-CSE-ConnectionGUID: obqJYAdvQwOxKULMC+rv9Q== X-CSE-MsgGUID: TtXohjfAQe2MZ1aT3nFD8A== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="35962097" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="35962097" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:41 -0700 X-CSE-ConnectionGUID: +xjUFJoCSuK7oSfxov+3Dg== X-CSE-MsgGUID: 13uKQSYtSg2yXBTF5IIYBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="28098199" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 03 May 2024 10:19:39 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4C29343A; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 04/13] serial: 8250_exar: Use PCI_SUBVENDOR_ID_IBM for subvendor ID Date: Fri, 3 May 2024 20:15:56 +0300 Message-ID: <20240503171917.2921250-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use PCI_SUBVENDOR_ID_IBM for subvendor ID instead of vendor one. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index ab0abc14ecf8..5405a1f463f1 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -1752,7 +1752,7 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { PCI_DEVICE_SUB( \ PCI_VENDOR_ID_EXAR, \ PCI_DEVICE_ID_EXAR_##devid, \ - PCI_VENDOR_ID_IBM, \ + PCI_SUBVENDOR_ID_IBM, \ PCI_SUBDEVICE_ID_IBM_##sdevid), 0, 0, \ (kernel_ulong_t)&bd \ } From patchwork Fri May 3 17:15:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794595 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 27EAF1586F2; Fri, 3 May 2024 17:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756786; cv=none; b=G8Wye6y0dD8FGDqWpVT8iCcu5uSqMvgGAd2njPIV8r/yCylxA0vm3Z/HYuClGFwdr05Y30cjWRoU95eGcqj1WcqnK+oxhhHMSSCnJKOgfc/pEH5RK+JHWCKQFCZPS1j3yKPGBYyxg0zA0L++ZBDYhXOqW7g1k4tevYrG+6PuwZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756786; c=relaxed/simple; bh=MPc1IkmPTaUhh/egUaTmEy/dFmjevrLUOTFIWjFB7BM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LEfAnI2MPIC5/6uDoDRWJtHdHJWXf4qtUuKXp3iz2d0Nq/N2KU5AQzFHPSjq+vLLbXldrk+7jPDqdPms1yJLSbHqZDCaYO/boksi0YJ2Q2iYB6BXZQQwLxAenXf611KvLkQ1TFsLFHCwh2bg3YbyU8mGAS0FIsnIgOtIs2ZG1io= 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=TYl7MXPs; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TYl7MXPs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756785; x=1746292785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MPc1IkmPTaUhh/egUaTmEy/dFmjevrLUOTFIWjFB7BM=; b=TYl7MXPsBj6XrxGbFuJOpMydC3vbABQRhfGVeIfzV0/k/OoKYIKkCbFx Ir/61O2A3/13cUNkzF3w+aOEOXZU+lGaesJJk4dBUkcS11JxSFn9KK7UI J/zfOhJU547sKtbVVjb0cPxK7ikPA4V2kmRgm8JQUiq8gZe+9I0UQwutZ edKsJwxfp7UvQ+glTYgWER1xqqeF2Nazw5l4OfnRfzKd7FcWr7r7zzl4q doQQhdASEBQtHzYeTGM8BTEd8uzhykj5jb+J+VLv8Q/vw9JL/iGpJfe/w rXW0v3UnsVgMfI76wdYtuteZ5qd6lX2gCewSZNs0zc8asq4Fx1MzRcv3K Q==; X-CSE-ConnectionGUID: Upm29KpxS1SmVcYFOh+jzQ== X-CSE-MsgGUID: yxPUdOvSQLSHgZF6IGtYQA== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="35962101" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="35962101" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: 9tB/PKX/TfqYjS5KRX+CRw== X-CSE-MsgGUID: Yo6YW076Scmhcl3H3n7Jhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="28098214" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5AD96445; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 05/13] serial: 8250_exar: Trivia typo fixes Date: Fri, 3 May 2024 20:15:57 +0300 Message-ID: <20240503171917.2921250-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Trivia typo fixes: interupts --> interrupts and others. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 5405a1f463f1..ac373cde7e39 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -641,7 +641,7 @@ pci_fastcom335_setup(struct exar8250 *priv, struct pci_dev *pcidev, * @port_num: Port number to set tristate off * * Most RS485 capable cards have a power on tristate jumper/switch that ensures - * the RS422/RS485 transciever does not drive a multi-drop RS485 bus when it is + * the RS422/RS485 transceiver does not drive a multi-drop RS485 bus when it is * not the master. When this jumper is installed the user must set the RS485 * mode to Full or Half duplex to disable tristate prior to using the port. * @@ -666,7 +666,7 @@ static int cti_tristate_disable(struct exar8250 *priv, unsigned int port_num) * @priv: Device's private structure * * Some older CTI cards require MPIO_0 to be set low to enable the - * interupts from the UART to the PLX PCI->PCIe bridge. + * interrupts from the UART to the PLX PCI->PCIe bridge. * * Return: 0 on success, negative error code on failure */ @@ -927,7 +927,7 @@ static int cti_port_setup_fpga(struct exar8250 *priv, port_type = cti_get_port_type_fpga(priv, pcidev, idx); - // FPGA shares port offests with XR17C15X + // FPGA shares port offsets with XR17C15X offset = idx * UART_EXAR_XR17C15X_PORT_OFFSET; port->port.type = PORT_XR17D15X; @@ -1109,7 +1109,7 @@ static int cti_board_init_xr17v25x(struct exar8250 *priv, priv->osc_freq = osc_freq; - /* enable interupts on cards that need the "PLX fix" */ + /* enable interrupts on cards that need the "PLX fix" */ switch (pcidev->subsystem_device) { case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_A: From patchwork Fri May 3 17:15:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794817 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 0075D1586C0; Fri, 3 May 2024 17:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756786; cv=none; b=PcaSp7k3fyVk2QND3kSp6BEWlL9VFJ+MY0O5cSf8kGSOLveg9kb2tmYYzyQ0dGZG3TFll7M3iNZbqc+H72yNhkU6QAbb3qrw0wO6TqwR3CLvtozPKjVMiomhOvxXs6O6GG49CnWUli/L4sjrW/Yk2H2/TT0l/6yAkJzMXDsbpog= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756786; c=relaxed/simple; bh=Hcgz7372JSWmrvRQywcGylEztD7txJvhGznmILq6zB4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pebHZ868J6iFkloq/RcKeGizvDP3Qj9V1KnwOlpiDdCSSZm6pAniXQTp92AvG08wNZ83OvZCdHrIgOF2IfiF5zoEMtPBtFRqQ4LvI8dZYuQ6NZHesJ345Mo+jTdCRKnu7t0//RVG9NVMgmDhoyuWQM7JFFVn2eHwrxjo8+LNI0w= 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=GYLqjtvl; arc=none smtp.client-ip=192.198.163.16 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GYLqjtvl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756785; x=1746292785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hcgz7372JSWmrvRQywcGylEztD7txJvhGznmILq6zB4=; b=GYLqjtvldvH6QwwH8Lns9yQsk6jGcCfDUSYKI3QmtNYt0J4cUgIU3vDk nXDNF6tO3rX/8BzQY8voa9u4COCzT9kLOLp1PpBArZ/x3mEp/IhQbb1mc 0A1ahILEjSxErTMoVTMgwK4FWLNmk9twdOxGavxGIqSCIAjc1Ly5do64C FYuGNtgQq1St6XEGq7hDvJJ69/IaU3VZdac3O0nX+wfVLipBtrMDz6U/m edu/3nU3KwXAp8bKQUEimU/h7hf/trGaP1P4v82jkdtYidq2nDzakr3IZ NmcT9nYkUNs/4GpBcUqTsM/eiXsML3VMTI/rdyrSCK36e53kkbXkjBBuA A==; X-CSE-ConnectionGUID: Jf2h6PuARM63v7pZZsM6IQ== X-CSE-MsgGUID: PI7NB5/4RSalkxl5A3hn5w== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="11107808" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="11107808" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: 0S5fgwx+RuGGjX3mv209/g== X-CSE-MsgGUID: vq5wy9W0SKq6Swtvz3e3Hg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="58415424" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 606F91C7; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 06/13] serial: 8250_exar: Extract cti_board_init_osc_freq() helper Date: Fri, 3 May 2024 20:15:58 +0300 Message-ID: <20240503171917.2921250-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Extract cti_board_init_osc_freq() helper to avoid code duplication. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 48 ++++++++++++----------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index ac373cde7e39..956323e2de4a 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -695,7 +695,6 @@ static int cti_read_osc_freq(struct exar8250 *priv, u8 eeprom_offset) { u16 lower_word; u16 upper_word; - int osc_freq; lower_word = exar_ee_read(priv, eeprom_offset); // Check if EEPROM word was blank @@ -706,10 +705,8 @@ static int cti_read_osc_freq(struct exar8250 *priv, u8 eeprom_offset) if (upper_word == 0xFFFF) return -EIO; - osc_freq = FIELD_PREP(CTI_EE_MASK_OSC_FREQ_LOWER, lower_word) | - FIELD_PREP(CTI_EE_MASK_OSC_FREQ_UPPER, upper_word); - - return osc_freq; + return FIELD_PREP(CTI_EE_MASK_OSC_FREQ_LOWER, lower_word) | + FIELD_PREP(CTI_EE_MASK_OSC_FREQ_UPPER, upper_word); } /** @@ -890,6 +887,19 @@ static int cti_rs485_config_mpio_tristate(struct uart_port *port, return cti_tristate_disable(priv, port->port_id); } +static void cti_board_init_osc_freq(struct exar8250 *priv, struct pci_dev *pcidev, u8 eeprom_offset) +{ + int osc_freq; + + osc_freq = cti_read_osc_freq(priv, eeprom_offset); + if (osc_freq <= 0) { + dev_warn(&pcidev->dev, "failed to read OSC freq from EEPROM, using default\n"); + osc_freq = CTI_DEFAULT_PCI_OSC_FREQ; + } + + priv->osc_freq = osc_freq; +} + static int cti_port_setup_common(struct exar8250 *priv, struct pci_dev *pcidev, int idx, unsigned int offset, @@ -1095,19 +1105,9 @@ static int cti_board_init_xr17v35x(struct exar8250 *priv, return 0; } -static int cti_board_init_xr17v25x(struct exar8250 *priv, - struct pci_dev *pcidev) +static int cti_board_init_xr17v25x(struct exar8250 *priv, struct pci_dev *pcidev) { - int osc_freq; - - osc_freq = cti_read_osc_freq(priv, CTI_EE_OFF_XR17V25X_OSC_FREQ); - if (osc_freq < 0) { - dev_warn(&pcidev->dev, - "failed to read osc freq from EEPROM, using default\n"); - osc_freq = CTI_DEFAULT_PCI_OSC_FREQ; - } - - priv->osc_freq = osc_freq; + cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17V25X_OSC_FREQ); /* enable interrupts on cards that need the "PLX fix" */ switch (pcidev->subsystem_device) { @@ -1123,19 +1123,9 @@ static int cti_board_init_xr17v25x(struct exar8250 *priv, return 0; } -static int cti_board_init_xr17c15x(struct exar8250 *priv, - struct pci_dev *pcidev) +static int cti_board_init_xr17c15x(struct exar8250 *priv, struct pci_dev *pcidev) { - int osc_freq; - - osc_freq = cti_read_osc_freq(priv, CTI_EE_OFF_XR17C15X_OSC_FREQ); - if (osc_freq <= 0) { - dev_warn(&pcidev->dev, - "failed to read osc freq from EEPROM, using default\n"); - osc_freq = CTI_DEFAULT_PCI_OSC_FREQ; - } - - priv->osc_freq = osc_freq; + cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17C15X_OSC_FREQ); /* enable interrupts on cards that need the "PLX fix" */ switch (pcidev->subsystem_device) { From patchwork Fri May 3 17:15:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794593 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 D2D4F158A11; Fri, 3 May 2024 17:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; cv=none; b=CkP42lsNTgSJj5NJMQkpUQ/4hpIUUTSf/GNOXPSxBlPMtavDfwn7nhnt9okur5mRw4icl+KY0ZKQKy4cHa1gBVFA04QA4B6vXVN0KEnNi5LngeuKrk4zyEZIXgd2RBgMOsOdyRnGaMW1dr/lMx1qG7ws7juXnYThCqAK0B7HpXE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; c=relaxed/simple; bh=t7c+p4jpADujsd+7SJ8cKecOyJnSYgDmtGkvtDrO4RE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uRxMZxlEpklliV8T+36MKNs2pgIhtQJlTFsTZE+dtXzvdkmW7L2KXZyIpdHuTlN32ZDcSTc1PsoN5wbKP/a6hPjgqpv7Eo9IIJDSNSe4WvOs6HJZrngAsFCjGtsuXLzrUI8RdOkBofOcOgRs2i+y0bpifampA1GkpV89rXf4J60= 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=IQoShJpv; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IQoShJpv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756787; x=1746292787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t7c+p4jpADujsd+7SJ8cKecOyJnSYgDmtGkvtDrO4RE=; b=IQoShJpvrKEjRLIsB57G+q5fUk+RzDdkWhrug3LNSE/87k0bKhcseHF4 enwfFX+BzLLejnR4zN1t5rfm+zUbZlZQ/XiZTKvHx37CZW2jxBcNTK2X+ k66eUmW2YfIQSHDwVNRQwqsIn7iWdW3C3NtdegW9ju5MQum1DFLgLgKYJ Ig9Hch4F4XsPisd1Z8PjcXFNLKOAh5xVqEDYoFWnsfby1b07pDPGKGG38 7FzMPA5xmxquDMaXmftJsN1wcoS15dxFoUEa/eRsc2Z7cemWCVHtXNutJ n7oXgf1/BKZZEPuMkYyz5nJe+wVD0bflK1H8bm0XguMMRSxz6heF5Is3M Q==; X-CSE-ConnectionGUID: X2Ky3Cp+TgO2/+vb97CLdA== X-CSE-MsgGUID: IRScyTMTRcGair20WivaSw== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="35962110" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="35962110" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: Bbxgvt4bQmmZ/eSKS4XsMA== X-CSE-MsgGUID: r7e17UhLT0evcRHOG9kc7w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="28098216" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6F95E501; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 07/13] serial: 8250_exar: Kill unneeded ->board_init() Date: Fri, 3 May 2024 20:15:59 +0300 Message-ID: <20240503171917.2921250-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We may reuse ->setup() for the same purpose as it was done before. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 171 +++++++++++++--------------- 1 file changed, 81 insertions(+), 90 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 956323e2de4a..4e683ca76de0 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -237,14 +237,12 @@ struct exar8250_platform { * struct exar8250_board - board information * @num_ports: number of serial ports * @reg_shift: describes UART register mapping in PCI memory - * @board_init: quirk run once at ->probe() stage before setting up ports * @setup: quirk run at ->probe() stage for each port * @exit: quirk run at ->remove() stage */ struct exar8250_board { unsigned int num_ports; unsigned int reg_shift; - int (*board_init)(struct exar8250 *priv, struct pci_dev *pcidev); int (*setup)(struct exar8250 *priv, struct pci_dev *pcidev, struct uart_8250_port *port, int idx); void (*exit)(struct pci_dev *pcidev); @@ -907,9 +905,6 @@ static int cti_port_setup_common(struct exar8250 *priv, { int ret; - if (priv->osc_freq == 0) - return -EINVAL; - port->port.port_id = idx; port->port.uartclk = priv->osc_freq; @@ -927,6 +922,30 @@ static int cti_port_setup_common(struct exar8250 *priv, return 0; } +static int cti_board_init_fpga(struct exar8250 *priv, struct pci_dev *pcidev) +{ + int ret; + u16 cfg_val; + + // FPGA OSC is fixed to the 33MHz PCI clock + priv->osc_freq = CTI_DEFAULT_FPGA_OSC_FREQ; + + // Enable external interrupts in special cfg space register + ret = pci_read_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, &cfg_val); + if (ret) + return pcibios_err_to_errno(ret); + + cfg_val |= CTI_FPGA_CFG_INT_EN_EXT_BIT; + ret = pci_write_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, cfg_val); + if (ret) + return pcibios_err_to_errno(ret); + + // RS485 gate needs to be enabled; otherwise RTS/CTS will not work + exar_write_reg(priv, CTI_FPGA_RS485_IO_REG, 0x01); + + return 0; +} + static int cti_port_setup_fpga(struct exar8250 *priv, struct pci_dev *pcidev, struct uart_8250_port *port, @@ -934,6 +953,13 @@ static int cti_port_setup_fpga(struct exar8250 *priv, { enum cti_port_type port_type; unsigned int offset; + int ret; + + if (idx == 0) { + ret = cti_board_init_fpga(priv, pcidev); + if (ret) + return ret; + } port_type = cti_get_port_type_fpga(priv, pcidev, idx); @@ -953,6 +979,12 @@ static int cti_port_setup_fpga(struct exar8250 *priv, return cti_port_setup_common(priv, pcidev, idx, offset, port); } +static void cti_board_init_xr17v35x(struct exar8250 *priv, struct pci_dev *pcidev) +{ + // XR17V35X uses the PCIe clock rather than an oscillator + priv->osc_freq = CTI_DEFAULT_PCIE_OSC_FREQ; +} + static int cti_port_setup_xr17v35x(struct exar8250 *priv, struct pci_dev *pcidev, struct uart_8250_port *port, @@ -962,6 +994,9 @@ static int cti_port_setup_xr17v35x(struct exar8250 *priv, unsigned int offset; int ret; + if (idx == 0) + cti_board_init_xr17v35x(priv, pcidev); + port_type = cti_get_port_type_xr17v35x(priv, pcidev, idx); offset = idx * UART_EXAR_XR17V35X_PORT_OFFSET; @@ -999,6 +1034,22 @@ static int cti_port_setup_xr17v35x(struct exar8250 *priv, return 0; } +static void cti_board_init_xr17v25x(struct exar8250 *priv, struct pci_dev *pcidev) +{ + cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17V25X_OSC_FREQ); + + /* enable interrupts on cards that need the "PLX fix" */ + switch (pcidev->subsystem_device) { + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS: + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_A: + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_B: + cti_plx_int_enable(priv); + break; + default: + break; + } +} + static int cti_port_setup_xr17v25x(struct exar8250 *priv, struct pci_dev *pcidev, struct uart_8250_port *port, @@ -1008,6 +1059,9 @@ static int cti_port_setup_xr17v25x(struct exar8250 *priv, unsigned int offset; int ret; + if (idx == 0) + cti_board_init_xr17v25x(priv, pcidev); + port_type = cti_get_port_type_xr17c15x_xr17v25x(priv, pcidev, idx); offset = idx * UART_EXAR_XR17V25X_PORT_OFFSET; @@ -1055,6 +1109,25 @@ static int cti_port_setup_xr17v25x(struct exar8250 *priv, return 0; } +static void cti_board_init_xr17c15x(struct exar8250 *priv, struct pci_dev *pcidev) +{ + cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17C15X_OSC_FREQ); + + /* enable interrupts on cards that need the "PLX fix" */ + switch (pcidev->subsystem_device) { + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS: + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_A: + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_B: + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS_OPTO: + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_A: + case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_B: + cti_plx_int_enable(priv); + break; + default: + break; + } +} + static int cti_port_setup_xr17c15x(struct exar8250 *priv, struct pci_dev *pcidev, struct uart_8250_port *port, @@ -1063,6 +1136,9 @@ static int cti_port_setup_xr17c15x(struct exar8250 *priv, enum cti_port_type port_type; unsigned int offset; + if (idx == 0) + cti_board_init_xr17c15x(priv, pcidev); + port_type = cti_get_port_type_xr17c15x_xr17v25x(priv, pcidev, idx); offset = idx * UART_EXAR_XR17C15X_PORT_OFFSET; @@ -1096,78 +1172,6 @@ static int cti_port_setup_xr17c15x(struct exar8250 *priv, return cti_port_setup_common(priv, pcidev, idx, offset, port); } -static int cti_board_init_xr17v35x(struct exar8250 *priv, - struct pci_dev *pcidev) -{ - // XR17V35X uses the PCIe clock rather than an oscillator - priv->osc_freq = CTI_DEFAULT_PCIE_OSC_FREQ; - - return 0; -} - -static int cti_board_init_xr17v25x(struct exar8250 *priv, struct pci_dev *pcidev) -{ - cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17V25X_OSC_FREQ); - - /* enable interrupts on cards that need the "PLX fix" */ - switch (pcidev->subsystem_device) { - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS: - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_A: - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_16_XPRS_B: - cti_plx_int_enable(priv); - break; - default: - break; - } - - return 0; -} - -static int cti_board_init_xr17c15x(struct exar8250 *priv, struct pci_dev *pcidev) -{ - cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17C15X_OSC_FREQ); - - /* enable interrupts on cards that need the "PLX fix" */ - switch (pcidev->subsystem_device) { - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS: - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_A: - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_B: - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_XPRS_OPTO: - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_A: - case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XPRS_OPTO_B: - cti_plx_int_enable(priv); - break; - default: - break; - } - - return 0; -} - -static int cti_board_init_fpga(struct exar8250 *priv, struct pci_dev *pcidev) -{ - int ret; - u16 cfg_val; - - // FPGA OSC is fixed to the 33MHz PCI clock - priv->osc_freq = CTI_DEFAULT_FPGA_OSC_FREQ; - - // Enable external interrupts in special cfg space register - ret = pci_read_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, &cfg_val); - if (ret) - return pcibios_err_to_errno(ret); - - cfg_val |= CTI_FPGA_CFG_INT_EN_EXT_BIT; - ret = pci_write_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, cfg_val); - if (ret) - return pcibios_err_to_errno(ret); - - // RS485 gate needs to be enabled; otherwise RTS/CTS will not work - exar_write_reg(priv, CTI_FPGA_RS485_IO_REG, 0x01); - - return 0; -} - static int pci_xr17c154_setup(struct exar8250 *priv, struct pci_dev *pcidev, struct uart_8250_port *port, int idx) @@ -1574,15 +1578,6 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) if (rc) return rc; - if (board->board_init) { - rc = board->board_init(priv, pcidev); - if (rc) { - dev_err_probe(&pcidev->dev, rc, - "failed to init serial board\n"); - return rc; - } - } - for (i = 0; i < nr_ports && i < maxnr; i++) { rc = board->setup(priv, pcidev, &uart, i); if (rc) { @@ -1664,22 +1659,18 @@ static const struct exar8250_board pbn_fastcom335_8 = { }; static const struct exar8250_board pbn_cti_xr17c15x = { - .board_init = cti_board_init_xr17c15x, .setup = cti_port_setup_xr17c15x, }; static const struct exar8250_board pbn_cti_xr17v25x = { - .board_init = cti_board_init_xr17v25x, .setup = cti_port_setup_xr17v25x, }; static const struct exar8250_board pbn_cti_xr17v35x = { - .board_init = cti_board_init_xr17v35x, .setup = cti_port_setup_xr17v35x, }; static const struct exar8250_board pbn_cti_fpga = { - .board_init = cti_board_init_fpga, .setup = cti_port_setup_fpga, }; From patchwork Fri May 3 17:16:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794594 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 8F456158853; Fri, 3 May 2024 17:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; cv=none; b=h+NuEtxjLaZ0mQKeDtil2pOkwChPDpQK5XL4YAPufaN8oA7Q++qZmXBMgg6vJy8hn0ZYbGgw5PQjmPPsCwCWTei1hABy/iIJ2aEqFGZWvFXMAl9HVQY9jtfZv+dhjqxYKjlHGBJ2wtEzfdxPyjqnvu4P7kBXbLy/nTiFVTGU0Dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; c=relaxed/simple; bh=0P8W5/r5S5k6SwXf7VCCJC2Qrhne6InBiWz5NUC6oPI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KuVYL9XlV7LeEBI7hCjOMSfu5GQJJfawb/Foa60GcRaftgQxEAyZptx1VeZP8E3wMTwsyv0164BOIDj+mLSQu5RmxlocdVUIfsIHLLOJ3q4fWgfqFJlFezDXffufz5qM5dnwEguXelxS2oJe97QM8Hew3yke4vb++7EsHrK1lrc= 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=XT6mUd65; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XT6mUd65" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756785; x=1746292785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0P8W5/r5S5k6SwXf7VCCJC2Qrhne6InBiWz5NUC6oPI=; b=XT6mUd654wiUQ4Bq6uOrr9wsmOdImXThpaztTL/RlDlZEu0CZfGTg8gl eTYGZuePM6CYUJXC8sWAJ8QFRhtyo5puZ7xrDd/mpvCcA22JtWRzhTutH ocMgFoaAxZDgybcGJVANu50+r96yp4uyhZj3gnnQzGRzYcIbHZr2M0VOP lUYiYg6TbpfAPquZgqbhjVSZtjGug4JLKdlaRoS95u/RJ739klGza6Uxr i6VVXOIIzX3WQA16VwGAvt9rDI6zpRfA3joms4hYXZfKFDnJlWf5XUXOY tcmM/IBowg4ORfsE0imXfAozDvBudrEEoxwpvPB9WrX2gbhrs5ryQAI/C Q==; X-CSE-ConnectionGUID: e6aR1tFZSK6ES7ORgJJS/w== X-CSE-MsgGUID: 9hq/X+e4SISmHqtSFz/JeA== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="35962105" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="35962105" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: VRw+1/qcSJafBnw+I0soJw== X-CSE-MsgGUID: cbpKREC1TyGqC+jHb26UvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="28098215" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7521F48B; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 08/13] serial: 8250_exar: Decrease indentation level Date: Fri, 3 May 2024 20:16:00 +0300 Message-ID: <20240503171917.2921250-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Decrease indentation level in some places. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 100 ++++++++++++++-------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 4e683ca76de0..1f04d4562878 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -607,28 +607,30 @@ pci_fastcom335_setup(struct exar8250 *priv, struct pci_dev *pcidev, writeb(32, p + UART_EXAR_TXTRG); writeb(32, p + UART_EXAR_RXTRG); + /* Skip the initial (per device) setup */ + if (idx) + return 0; + /* * Setup Multipurpose Input/Output pins. */ - if (idx == 0) { - switch (pcidev->device) { - case PCI_DEVICE_ID_COMMTECH_4222PCI335: - case PCI_DEVICE_ID_COMMTECH_4224PCI335: - writeb(0x78, p + UART_EXAR_MPIOLVL_7_0); - writeb(0x00, p + UART_EXAR_MPIOINV_7_0); - writeb(0x00, p + UART_EXAR_MPIOSEL_7_0); - break; - case PCI_DEVICE_ID_COMMTECH_2324PCI335: - case PCI_DEVICE_ID_COMMTECH_2328PCI335: - writeb(0x00, p + UART_EXAR_MPIOLVL_7_0); - writeb(0xc0, p + UART_EXAR_MPIOINV_7_0); - writeb(0xc0, p + UART_EXAR_MPIOSEL_7_0); - break; - } - writeb(0x00, p + UART_EXAR_MPIOINT_7_0); - writeb(0x00, p + UART_EXAR_MPIO3T_7_0); - writeb(0x00, p + UART_EXAR_MPIOOD_7_0); + switch (pcidev->device) { + case PCI_DEVICE_ID_COMMTECH_4222PCI335: + case PCI_DEVICE_ID_COMMTECH_4224PCI335: + writeb(0x78, p + UART_EXAR_MPIOLVL_7_0); + writeb(0x00, p + UART_EXAR_MPIOINV_7_0); + writeb(0x00, p + UART_EXAR_MPIOSEL_7_0); + break; + case PCI_DEVICE_ID_COMMTECH_2324PCI335: + case PCI_DEVICE_ID_COMMTECH_2328PCI335: + writeb(0x00, p + UART_EXAR_MPIOLVL_7_0); + writeb(0xc0, p + UART_EXAR_MPIOINV_7_0); + writeb(0xc0, p + UART_EXAR_MPIOSEL_7_0); + break; } + writeb(0x00, p + UART_EXAR_MPIOINT_7_0); + writeb(0x00, p + UART_EXAR_MPIO3T_7_0); + writeb(0x00, p + UART_EXAR_MPIOOD_7_0); return 0; } @@ -853,21 +855,19 @@ static enum cti_port_type cti_get_port_type_xr17v35x(struct exar8250 *priv, port_flags = exar_ee_read(priv, offset); port_type = FIELD_GET(CTI_EE_MASK_PORT_FLAGS_TYPE, port_flags); - if (!CTI_PORT_TYPE_VALID(port_type)) { - /* - * If the port type is missing the card assume it is a - * RS232/RS422/RS485 card to be safe. - * - * There is one known board (BEG013) that only has - * 3 of 4 port types written to the EEPROM so this - * acts as a work around. - */ - dev_warn(&pcidev->dev, - "failed to get port %d type from EEPROM\n", port_num); - port_type = CTI_PORT_TYPE_RS232_422_485_HW; - } + if (CTI_PORT_TYPE_VALID(port_type)) + return port_type; - return port_type; + /* + * If the port type is missing the card assume it is a + * RS232/RS422/RS485 card to be safe. + * + * There is one known board (BEG013) that only has 3 of 4 port types + * written to the EEPROM so this acts as a work around. + */ + dev_warn(&pcidev->dev, "failed to get port %d type from EEPROM\n", port_num); + + return CTI_PORT_TYPE_RS232_422_485_HW; } static int cti_rs485_config_mpio_tristate(struct uart_port *port, @@ -1190,11 +1190,10 @@ static void setup_gpio(struct pci_dev *pcidev, u8 __iomem *p) * devices will export them as GPIOs, so we pre-configure them safely * as inputs. */ - u8 dir = 0x00; if ((pcidev->vendor == PCI_VENDOR_ID_EXAR) && - (pcidev->subsystem_vendor != PCI_VENDOR_ID_SEALEVEL)) { + (pcidev->subsystem_vendor != PCI_VENDOR_ID_SEALEVEL)) { // Configure GPIO as inputs for Commtech adapters dir = 0xff; } else { @@ -1284,27 +1283,28 @@ static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termio if (ret) return ret; - if (rs485->flags & SER_RS485_ENABLED) { - old_lcr = readb(p + UART_LCR); + if (!(rs485->flags & SER_RS485_ENABLED)) + return 0; - /* Set EFR[4]=1 to enable enhanced feature registers */ - efr = readb(p + UART_XR_EFR); - efr |= UART_EFR_ECB; - writeb(efr, p + UART_XR_EFR); + old_lcr = readb(p + UART_LCR); - /* Set MCR to use DTR as Auto-RS485 Enable signal */ - writeb(UART_MCR_OUT1, p + UART_MCR); + /* Set EFR[4]=1 to enable enhanced feature registers */ + efr = readb(p + UART_XR_EFR); + efr |= UART_EFR_ECB; + writeb(efr, p + UART_XR_EFR); - /* Set LCR[7]=1 to enable access to DLD register */ - writeb(old_lcr | UART_LCR_DLAB, p + UART_LCR); + /* Set MCR to use DTR as Auto-RS485 Enable signal */ + writeb(UART_MCR_OUT1, p + UART_MCR); - /* Set DLD[7]=1 for inverted RS485 Enable logic */ - dld = readb(p + UART_EXAR_DLD); - dld |= UART_EXAR_DLD_485_POLARITY; - writeb(dld, p + UART_EXAR_DLD); + /* Set LCR[7]=1 to enable access to DLD register */ + writeb(old_lcr | UART_LCR_DLAB, p + UART_LCR); - writeb(old_lcr, p + UART_LCR); - } + /* Set DLD[7]=1 for inverted RS485 Enable logic */ + dld = readb(p + UART_EXAR_DLD); + dld |= UART_EXAR_DLD_485_POLARITY; + writeb(dld, p + UART_EXAR_DLD); + + writeb(old_lcr, p + UART_LCR); return 0; } From patchwork Fri May 3 17:16:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794816 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 078501586C3; Fri, 3 May 2024 17:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756787; cv=none; b=hxmg7G5oO+AvPhpqESqiBIT0fBsDor93RrCqHLZfKRWI7x9aiD/5EQI8SOfYdgbx3PgAPwYwn+t0+OeXrutXc3/uvbp9UHca8DV3GgeuYd+kkj9ROn8va82iY/CXnVINyg3ZgZQxCrFSMy8ExDr1l/nCp/GAGF/fBZg2Bp1Y2oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756787; c=relaxed/simple; bh=lcpyqo/kIZ8bG16xlC0SZOBkBwextMe9kvhdGFvCZgI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DLo6jfoP2b+gjMKaoClX1yYkHs5j30fsZBc4U7loTszY/cDdSzY7G54DEUg47B+KAnk7ZH8NxdvJyVnKWaAWVIYfUpiCmGQ5QtDCOuaE/hJZtI/uGaP9CZTlfTvZVWZx/YEFDYL3v/Bnu1XgIAHZfgvVNBBE8xA+m2fmQ/vbJtg= 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=kTPJD5uS; arc=none smtp.client-ip=192.198.163.16 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kTPJD5uS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756785; x=1746292785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lcpyqo/kIZ8bG16xlC0SZOBkBwextMe9kvhdGFvCZgI=; b=kTPJD5uSjJDaxkTOG+ZpcGVMZ789pdj3w0lH+PtFPp7y9IrQ8C6OfCOP +/kAejbQW1W0RhTw9axMqoD0ZPVkd9tSsTqfb3Z+31NK5kOlPUpwJwvTq 8tLAxhu+6a8WH9EL1YWYQbbC74qgJpE1UMKtsLUcIqpPwmvmCtBz+pkgi 4nc7t2oeLrP8bnvtKn9GqiLoL8okfeZFx997r/xlNidJjuolP7w+zdCXe KtuSf2+kA/wsYPQIugZDuUBQI2vNXMS/Mi+4uXfqott34A8FtHd6JRFm2 DPQoDloXEePJSLTCaSU08bfvGUtEjh+5W3OCQG7w2ZRRL9i2xqz5Uocf2 Q==; X-CSE-ConnectionGUID: +8eOfZ4BTYiR/x0QK7LDOA== X-CSE-MsgGUID: XRweAGkuRrWif1pMnZl1bw== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="11107813" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="11107813" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: JFEUDPVcRUOnQUsleNNKeA== X-CSE-MsgGUID: 8++WEltPRQy99xJDxy4cxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="58415425" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 831D4713; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 09/13] serial: 8250_exar: Return directly from switch-cases Date: Fri, 3 May 2024 20:16:01 +0300 Message-ID: <20240503171917.2921250-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are two similar switch-cases which use different style. Unify them and one more to return from the cases directly. While at it, add missing default in another switch-case. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 80 +++++++++++------------------ 1 file changed, 29 insertions(+), 51 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 1f04d4562878..51f6af16c557 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -627,6 +627,8 @@ pci_fastcom335_setup(struct exar8250 *priv, struct pci_dev *pcidev, writeb(0xc0, p + UART_EXAR_MPIOINV_7_0); writeb(0xc0, p + UART_EXAR_MPIOSEL_7_0); break; + default: + break; } writeb(0x00, p + UART_EXAR_MPIOINT_7_0); writeb(0x00, p + UART_EXAR_MPIO3T_7_0); @@ -723,8 +725,6 @@ static enum cti_port_type cti_get_port_type_xr17c15x_xr17v25x(struct exar8250 *p struct pci_dev *pcidev, unsigned int port_num) { - enum cti_port_type port_type; - switch (pcidev->subsystem_device) { // RS232 only cards case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232: @@ -734,24 +734,17 @@ static enum cti_port_type cti_get_port_type_xr17c15x_xr17v25x(struct exar8250 *p case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_232_NS: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_232: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_232_NS: - port_type = CTI_PORT_TYPE_RS232; - break; + return CTI_PORT_TYPE_RS232; // 1x RS232, 1x RS422/RS485 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1: - port_type = (port_num == 0) ? - CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; - break; + return (port_num == 0) ? CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; // 2x RS232, 2x RS422/RS485 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2: - port_type = (port_num < 2) ? - CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; - break; + return (port_num < 2) ? CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; // 4x RS232, 4x RS422/RS485 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4_SP: - port_type = (port_num < 4) ? - CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; - break; + return (port_num < 4) ? CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; // RS232/RS422/RS485 HW (jumper) selectable case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4: @@ -774,32 +767,24 @@ static enum cti_port_type cti_get_port_type_xr17c15x_xr17v25x(struct exar8250 *p case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_XP_OPTO: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4_XPRS_OPTO: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP: - port_type = CTI_PORT_TYPE_RS232_422_485_HW; - break; + return CTI_PORT_TYPE_RS232_422_485_HW; // RS422/RS485 HW (jumper) selectable case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_SP_485: case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_XPRS_LP_485: - port_type = CTI_PORT_TYPE_RS422_485; - break; + return CTI_PORT_TYPE_RS422_485; // 6x RS232, 2x RS422/RS485 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_6_2_SP: - port_type = (port_num < 6) ? - CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; - break; + return (port_num < 6) ? CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; // 2x RS232, 6x RS422/RS485 case PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_6_SP: - port_type = (port_num < 2) ? - CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; - break; + return (port_num < 2) ? CTI_PORT_TYPE_RS232 : CTI_PORT_TYPE_RS422_485; default: dev_err(&pcidev->dev, "unknown/unsupported device\n"); - port_type = CTI_PORT_TYPE_NONE; + return CTI_PORT_TYPE_NONE; } - - return port_type; } /** @@ -816,20 +801,15 @@ static enum cti_port_type cti_get_port_type_fpga(struct exar8250 *priv, struct pci_dev *pcidev, unsigned int port_num) { - enum cti_port_type port_type; - switch (pcidev->device) { case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG00X: case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG01X: case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_16: - port_type = CTI_PORT_TYPE_RS232_422_485_HW; - break; + return CTI_PORT_TYPE_RS232_422_485_HW; default: dev_err(&pcidev->dev, "unknown/unsupported device\n"); return CTI_PORT_TYPE_NONE; } - - return port_type; } /** @@ -1493,35 +1473,33 @@ static irqreturn_t exar_misc_handler(int irq, void *data) return IRQ_HANDLED; } -static unsigned int exar_get_nr_ports(struct exar8250_board *board, - struct pci_dev *pcidev) +static unsigned int exar_get_nr_ports(struct exar8250_board *board, struct pci_dev *pcidev) { - unsigned int nr_ports = 0; + if (pcidev->vendor == PCI_VENDOR_ID_ACCESSIO) + return BIT(((pcidev->device & 0x38) >> 3) - 1); - if (pcidev->vendor == PCI_VENDOR_ID_ACCESSIO) { - nr_ports = BIT(((pcidev->device & 0x38) >> 3) - 1); - } else if (board->num_ports > 0) { - // Check if board struct overrides number of ports - nr_ports = board->num_ports; - } else if (pcidev->vendor == PCI_VENDOR_ID_EXAR) { - // Exar encodes # ports in last nibble of PCI Device ID ex. 0358 - nr_ports = pcidev->device & 0x0f; - } else if (pcidev->vendor == PCI_VENDOR_ID_CONNECT_TECH) { - // Handle CTI FPGA cards + // Check if board struct overrides number of ports + if (board->num_ports > 0) + return board->num_ports; + + // Exar encodes # ports in last nibble of PCI Device ID ex. 0358 + if (pcidev->vendor == PCI_VENDOR_ID_EXAR) + return pcidev->device & 0x0f; + + // Handle CTI FPGA cards + if (pcidev->vendor == PCI_VENDOR_ID_CONNECT_TECH) { switch (pcidev->device) { case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG00X: case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_12_XIG01X: - nr_ports = 12; - break; + return 12; case PCI_DEVICE_ID_CONNECT_TECH_PCI_XR79X_16: - nr_ports = 16; - break; + return 16; default: - break; + return 0; } } - return nr_ports; + return 0; } static int From patchwork Fri May 3 17:16:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794815 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 A3024158A07; Fri, 3 May 2024 17:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; cv=none; b=fydnY7H/HXBoiRV59LMk78Rt1OXAMmXdec2o0s0c8fFnxXXjbs+HGWeDukLYrS7LlYJGeyM8G/k7TavXJF56RoFMSBuSYnWSfQI9MCldWgxOlQSBRDsXaneIJbM+92LvxpWUVtnYRzZgb9q6+5aIHyV3613DRUXw9AdCzIuX+rk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; c=relaxed/simple; bh=HSPO3BYYrHNKLlywx1qmFZnk+RVxu/4s6sl1HAdCBHQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h3OvGNywblhGdPrK4m0+VLZ4P/rfkm6IGm0jwOCl3TZYAK0qXCaBIPFyGKc5/oV/Lp5Tz0v8YYHFeWGbYma5Ug1OVanEld/FSaG3nm4MffFs38kJZQSt/YheG33iamL3vnO+q6WwoQdBoxFGI+vnZyxrGrtvgvqFBJl9HIXbzp8= 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=FM8XKVSs; arc=none smtp.client-ip=192.198.163.16 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FM8XKVSs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756786; x=1746292786; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HSPO3BYYrHNKLlywx1qmFZnk+RVxu/4s6sl1HAdCBHQ=; b=FM8XKVSsA4gMPahmf2QG5HxjUoPz3nLlD0cMeqToNBF8uLStG3T9gfzK lFWZm8rzszgArQbAiMTB1IM0bM/NtxyDwH0JCi1Bj233ecdS/lTIbuojA GEWST4th7iSkCMBA08Ygj7WrOg9LxSazQ3AyEGB+ApxJ8tXxtKw6FLspD wcwdf1GYLGdBdP861/V0fpbQV8cgzP1RPTHfS17tf8qYzAMNT1q82nZ2E YMkeeZ7B2V49RrYfEP7RIS3oOo9gAYnBjo616h39lopIQvPAmAj5CkmWO DQNMO5hPtwus7fIBiuSLfX+3khVf/6RwHY8AzkW1HcHPUncrwGV/VWmQE A==; X-CSE-ConnectionGUID: lduSk7ykTfG0NcnwiX+CGg== X-CSE-MsgGUID: 5Vq0t4bFR6C127elLUgLnQ== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="11107819" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="11107819" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: k7YE1zu7QG2Gy40YjxVtmg== X-CSE-MsgGUID: oVe/rjzDTTGMxgTvIVH2hA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="58415426" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8C2E5699; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 10/13] serial: 8250_exar: Switch to use dev_err_probe() Date: Fri, 3 May 2024 20:16:02 +0300 Message-ID: <20240503171917.2921250-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Switch to use dev_err_probe() to simplify the error path and unify a message template. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 51f6af16c557..306bc6d7c141 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -889,11 +889,8 @@ static int cti_port_setup_common(struct exar8250 *priv, port->port.uartclk = priv->osc_freq; ret = serial8250_pci_setup_port(pcidev, port, 0, offset, 0); - if (ret) { - dev_err(&pcidev->dev, - "failed to setup pci for port %d err: %d\n", idx, ret); + if (ret) return ret; - } port->port.private_data = (void *)priv; port->port.pm = exar_pm; @@ -1522,11 +1519,8 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) maxnr = pci_resource_len(pcidev, bar) >> (board->reg_shift + 3); nr_ports = exar_get_nr_ports(board, pcidev); - if (nr_ports == 0) { - dev_err_probe(&pcidev->dev, -ENODEV, - "failed to get number of ports\n"); - return -ENODEV; - } + if (nr_ports == 0) + return dev_err_probe(&pcidev->dev, -ENODEV, "failed to get number of ports\n"); priv = devm_kzalloc(&pcidev->dev, struct_size(priv, line, nr_ports), GFP_KERNEL); if (!priv) @@ -1559,7 +1553,7 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) for (i = 0; i < nr_ports && i < maxnr; i++) { rc = board->setup(priv, pcidev, &uart, i); if (rc) { - dev_err(&pcidev->dev, "Failed to setup port %u\n", i); + dev_err_probe(&pcidev->dev, rc, "Failed to setup port %u\n", i); break; } @@ -1568,10 +1562,9 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) priv->line[i] = serial8250_register_8250_port(&uart); if (priv->line[i] < 0) { - dev_err(&pcidev->dev, - "Couldn't register serial port %lx, irq %d, type %d, error %d\n", - uart.port.iobase, uart.port.irq, - uart.port.iotype, priv->line[i]); + dev_err_probe(&pcidev->dev, priv->line[i], + "Couldn't register serial port %lx, type %d, irq %d\n", + uart.port.iobase, uart.port.iotype, uart.port.irq); break; } } From patchwork Fri May 3 17:16:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794592 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 7BE0B15884C; Fri, 3 May 2024 17:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756789; cv=none; b=qHE35s0ZsdZfjvz+MMpsHd5fOOlM0tsFeFNzpUmGvQNdx0Njrh5Wk5M6Eyr6r1ccZgQfNmKmZSJ9Sic27f55szKUfA19F33r6E/LQcfolaE8ICaFzTnuPeNTMSyNdHJRPgygFq/b7cmTVsAsYUbaSJiIDnzD1rQ0fKr9WGTpOq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756789; c=relaxed/simple; bh=hObYXdggnnGcIGY/QpdcdvBx2An46+qLFoFlXZdehw8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WfYchPPzXbXXGlo4R7lo+A7ZU/Dw+bo6EZHknJWpZDOjYATlKrafxH0ZSYsKA/LjtBF4595vFjR4CITyc0jnKxE8EhAEQqq98CZfYpvpKQbR410WYyaDdJYzJXALsGmiSUZ6kewuAzqFIbiSjdSSm+ea5LN4pFVn4sfUacWyde0= 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=G8eUGwp/; arc=none smtp.client-ip=192.198.163.16 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="G8eUGwp/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756785; x=1746292785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hObYXdggnnGcIGY/QpdcdvBx2An46+qLFoFlXZdehw8=; b=G8eUGwp/93J20gykztza1xwRybtXzXM0FyYrvJk0HEnn7MqztQYvpWYi AXopZPmW53T/NArSvIHhRSyHKrndqE7wbZK1nnWFnAvaQvzFn2n8JuKAm s4XIPim2DuR7BxRk0MKmX57m55bu95hnaMmwEUSIJ4UbCqBLvb532cayP PLbTM/LaH+3o7O+R28i9xnLmw97T6EEqYBVgpAj6ayhthAiANjp8dNlbM 1gIBnmgev3GlZADE1g2Afp/8rzpVPujBuvysWgPXh9QsT4VqNauma4xIx Q6Vil1OVT6d1Fk/o9Yd5qUNhLtrNPkE/GiYRTxraeAh30Ey4M4eHMd8d6 w==; X-CSE-ConnectionGUID: j3zawxqLRcy9SZsjXBw6Vg== X-CSE-MsgGUID: zq6bbyDrRSiCyuFrUA9GiQ== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="11107817" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="11107817" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: L4cfylrMR8yzeftlaInYXQ== X-CSE-MsgGUID: SKSyKEq2RkSlxeQUzWOEFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="58415427" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9A3DDC01; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 11/13] serial: 8250_exar: Use BIT() in exar_ee_read() Date: Fri, 3 May 2024 20:16:03 +0300 Message-ID: <20240503171917.2921250-12-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use BIT() in exar_ee_read() like other functions do. While at it, explain the EEPROM type and the dummy bit requirement. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 306bc6d7c141..93d2c8dd3cd8 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -324,6 +324,7 @@ static inline u8 exar_ee_read_bit(struct exar8250 *priv) * @ee_addr: Offset of EEPROM to read word from * * Read a single 16bit word from an Exar UART's EEPROM. + * The type of the EEPROM is AT93C46D. * * Return: EEPROM word */ @@ -340,13 +341,13 @@ static u16 exar_ee_read(struct exar8250 *priv, u8 ee_addr) exar_ee_write_bit(priv, 0); // Send address to read from - for (i = 1 << (UART_EXAR_REGB_EE_ADDR_SIZE - 1); i; i >>= 1) - exar_ee_write_bit(priv, (ee_addr & i)); + for (i = UART_EXAR_REGB_EE_ADDR_SIZE - 1; i >= 0; i--) + exar_ee_write_bit(priv, ee_addr & BIT(i)); - // Read data 1 bit at a time - for (i = 0; i <= UART_EXAR_REGB_EE_DATA_SIZE; i++) { - data <<= 1; - data |= exar_ee_read_bit(priv); + // Read data 1 bit at a time starting with a dummy bit + for (i = UART_EXAR_REGB_EE_DATA_SIZE; i >= 0; i--) { + if (exar_ee_read_bit(priv)) + data |= BIT(i); } exar_ee_deselect(priv); From patchwork Fri May 3 17:16:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794814 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 493B3158A28; Fri, 3 May 2024 17:19:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; cv=none; b=sGdid1seeETx0+FvHnALqSSnd+0c0JfH/Vb9ZGvM2Wfbqp5CTR7G2fOpMR9kejHEQVTgQNnhsi3oY5A5IvVVe73UkoLx+0fmdxrQFzhMBQ0JI7oIhrDYlAoRW1SPsl27h2zFyinhawk7IZjs2+eDLHEpfqFIyu/bKG+EnccawHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756788; c=relaxed/simple; bh=ApZmymISPHSWnRB5/ENeA8JTBA7ROD/xcdRdMyHymqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gXCrWivdNT3dGe7vLIT7WIDerDYt15Q1anZbwNpFNEZL+6stwwPnrP/pwF77g5T0bAo4F2Zg7MusZu9JFx//VyvQ2BRJEe+7ddEHcoc3CBo7qrXXBK2Eh3lNPnuAfAuDNcmbQDTpfl1AKeBAF7EIxjBBEJx0lIt8zebL1/bHd00= 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=Zkb01Vkp; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Zkb01Vkp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756787; x=1746292787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ApZmymISPHSWnRB5/ENeA8JTBA7ROD/xcdRdMyHymqc=; b=Zkb01VkpHHRbUaDI/ugCLF5BEfmF+q2UCqAR/U3p6mPNybZAbvR7mCet 9sm2Ro523cNWT2hU3mJbK9gJ2vgpWHvVEaxg500jJNDgfGKEAPkAFVVj7 MT9Pu7EKZRlM0+eMPmzZWFGQt6x/WAIJRqD3UdQVWlxZvnBM4eJ5/x2Nh Yf/GjT/2kHwLZz0m/TPk2iGBjIxGxAGo/VEioDPh5XAuRURInOn9QrBKH 5FWndRUY3uvOv9ljgTXF5Si5sO99ZtjRr14IltcRgNUgxqWeYXj52B6sl WiaJ5m+sevvA+oAPfGLp/L0UYmww2DDRJrBHA3jVXIZr1xol58+D4yIS3 Q==; X-CSE-ConnectionGUID: Wu6QqbvwR/uQC5OW+RJFmA== X-CSE-MsgGUID: 3DCICFT/RF+QhiJBktZriQ== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="35962114" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="35962114" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: jR5XVg1lR4yM8jR9MMwgVA== X-CSE-MsgGUID: 8Mih6RDrQ0KulOp7OZRO8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="28098218" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9F717BDF; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 12/13] serial: 8250_exar: Make type of bit the same in exar_ee_*_bit() Date: Fri, 3 May 2024 20:16:04 +0300 Message-ID: <20240503171917.2921250-13-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Make type of bit parameter and returned one the same in exar_ee_*_bit(). Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 93d2c8dd3cd8..85085b73706c 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -280,7 +280,7 @@ static inline void exar_ee_deselect(struct exar8250 *priv) exar_write_reg(priv, UART_EXAR_REGB, 0x00); } -static inline void exar_ee_write_bit(struct exar8250 *priv, int bit) +static inline void exar_ee_write_bit(struct exar8250 *priv, u8 bit) { u8 value = UART_EXAR_REGB_EECS; From patchwork Fri May 3 17:16:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 794813 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 4A05F158D83; Fri, 3 May 2024 17:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756790; cv=none; b=RJUR6Mzy3/WqK7GxMhiLZ5vdZr4GDvdxo27Ogsp7KsNzpW0QTW+coFRL5r/rRYPu9lhTpxat/3VI9UL6oEeV0K6Lv/pReWSKzJjD2Blrpe8netTm6OqxfRJ8ED6cxgavy8gabSN0c0pXe0blckpm9zs/YsfNc1Z/7/SgHs2RSuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756790; c=relaxed/simple; bh=D3jt870yoFvqED61Si69xAWDTepSVEoraL3qTLi/MZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k+J5yQ64428XYn2uCCByg9wNKVywl7zYStx2/cR66Ocw3A2QXqPC8M8f7yLutEbEJj/IjFpK97cv982nXRzsjxE5DgSEhaU3dMIeHlFSQbDZeNan8EnbOOLFBuzjwTd7Ay1A4VC84R+3Dw/Cjb0W/D02Mcf1Ae7ny5/2dzDqLn0= 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=JpO6gdHM; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="JpO6gdHM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714756788; x=1746292788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D3jt870yoFvqED61Si69xAWDTepSVEoraL3qTLi/MZQ=; b=JpO6gdHMoKzo/39rggp7cxqzKpcPifvGBOBdc+1LXqczX50VFnuiygPi Agn2UhcpaZDcDmI52RaMXZt5pjSSMJ+IFbHFXBA0gSS5ROQ89bUDMQAP3 Pl2fS9GkzKfUBj5SgxSAMU0cSf3LEL49qwZf+yuRYxY2/DGoow5nFOBSK U2qwGWS9U+sl2p0BjT5QStLL0S6+3FwIxaHESq2hlr6p/6sGNJOL7e2mW IyWRmNREZaxyyNpoU5lgGZFKM8y6fpEKVpace5Txknm2XKi3k/OnVuUB7 oOXO+8By4asU4p7D6/iv9DbMxUKz1AR/pvjKGdPA8O91rXSscILehpl8Y A==; X-CSE-ConnectionGUID: 8OtsgXmFR7mtOsWSAgKM9w== X-CSE-MsgGUID: mM+2mnC5Sh6xJUqLR/wfgw== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="35962118" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="35962118" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 10:19:44 -0700 X-CSE-ConnectionGUID: mzw7Ut4cS1ahZgmqYKBp+w== X-CSE-MsgGUID: 7cXWdcVsRP25VozkTlFYGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="28098220" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 03 May 2024 10:19:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B2076C2A; Fri, 3 May 2024 20:19:38 +0300 (EEST) From: Andy Shevchenko To: Parker Newman , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 13/13] serial: 8250_exar: Keep the includes sorted Date: Fri, 3 May 2024 20:16:05 +0300 Message-ID: <20240503171917.2921250-14-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> References: <20240503171917.2921250-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Keep the includes sorted. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_exar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 85085b73706c..616128254bbd 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -6,6 +6,7 @@ * * Copyright (C) 2017 Sudip Mukherjee, All Rights Reserved. */ +#include #include #include #include @@ -20,7 +21,6 @@ #include #include #include -#include #include #include