Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1339365rbb; Mon, 26 Feb 2024 06:27:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUJmnZEhgMKcpFn1MgRlO8tAw4QFCQ73JEZ57qIGFw59suzvILkfmR+/xpUp23+lL3l/kXErg3ul1EY8MfFu2QsmpjEWuHR4I19xT0oIg== X-Google-Smtp-Source: AGHT+IEZivcMtIsr+Neod96CxVwUCgiLSYgKVHtcsLqFAG7OY6P8v1icUNQeHt6Lvb/aibkyQwGu X-Received: by 2002:a05:6808:120a:b0:3c1:9315:85ef with SMTP id a10-20020a056808120a00b003c1931585efmr6168180oil.29.1708957626705; Mon, 26 Feb 2024 06:27:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708957626; cv=pass; d=google.com; s=arc-20160816; b=GP/E+TIJjVEY6UdHwtKhEXWxBXDnkXUt9If5Y6V2Mfn2SE/B25RXiViDb4D0vwZUjf vIekxrEfcMP4MmEhZ1iZuiHGYbD41pt37no+h6W38N1j6To7t+qUXAK2DD4lKkjpMbrN oW+7W/8B0iiDKiyqo63oms2/bRWxq5on6NMp1weCKAS9qfUGvWYCMBi4pS+lDXojEi5b trhHkH7qCaGiTIoVZjbccCj+fh6gNG7OYmaCrEq0Mk6X63/zi/EMnPbQoUf4c3dEv94e RB/lu2oAABZvwOCmKtg5dDHhMgsnrsERs4NnqQtWK4gOnfOcAi15fetK0vYMCQxjQz5B 1Y7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=D4KwnVOpnJs/2gDd0FmR6JKNsGJUctJ5eHzVQBF+HqI=; fh=x+GyWh+d0fSlsBO19rBAGT/zXvddHk2lhaP+wXtmjdg=; b=xNIsDZrNFXVVCma++ZNEVrbfp75oU+ul4zdQ1OwC6kmYi1/gMeo5Rl2+JHEW9JOs5S qCTbac49l7wzx8ME82k0UuIoEVcToXzTPZnJ1Xco9IrMhV/7KHqeTUwsDcZ/HHG8texB TereBTP4QMTiPzOh5r/XHJBxwBbrkP0jsi5nVXAIbzJbpdm5Ckye3Je10LTmIhtG22vR WHwE8eNN973L0X/UzVOcmmVVw4+2FJE5NNjrYwg2H6BIx6Xt0dXOvmd2Fuxm2xrWhMqX B63pxiKjxbVi0dcTrJg7chJHc2FOdGpLyiA5Nv8ZXM/HMgqhxY0xY4TCE9UgJXSgFM5E AZYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DQTiLaoe; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a3-20020a056214062300b0068d039dbe5esi5113511qvx.492.2024.02.26.06.27.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 06:27:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DQTiLaoe; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 73FD71C29C29 for ; Mon, 26 Feb 2024 14:27:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0777B12C55F; Mon, 26 Feb 2024 14:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DQTiLaoe" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 A61E512C520; Mon, 26 Feb 2024 14:25:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708957533; cv=none; b=JDAkomHfYAt8PRvO8rbmdfM9apEyewJthJ93KSrhgYF7R6m+Ydfa9sbhOjDbaDe3Gz2jdX+jqvZXF1gWFRw0OZrcikwMDOUYd4eKWKHAZWLuRmX1xpINdWcwTtxtC57eaMK+UnPAPrx7LMrqKBTab5sGx0DiojT11oCYrUOwwXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708957533; c=relaxed/simple; bh=KeTPJX3iP5rGOV/714NN6qjfj4XXg/FxlTFlGOhpEw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iNpuD+DpCvowYAY8rToedrwFcpd5MncvFIEu/w7e0yyKyom4ZJxj55s5ptTph7+bsNw/51+gFzT3SYa7aM67/PhovIdj7lPd4sMqsa2kLRbPeqOjSOIE8EC0KMo9tkMr9+8PHKtfhUpIJ2fn/TDUkBAbCUTs3hPRkVSw8sBNeCU= 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=DQTiLaoe; arc=none smtp.client-ip=198.175.65.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708957532; x=1740493532; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KeTPJX3iP5rGOV/714NN6qjfj4XXg/FxlTFlGOhpEw4=; b=DQTiLaoeTKT0FbAK12eCszOivW0fPVVrp9xFjaxBHZdeFu2EWExeVBeF WLM8L1DvTRbJjP4T14AzOB5aa0RL6TI/9d5m9kdI1jHUOof5pP/QivYeL rvZmvQhmu0GgEKEzGclhZr+4t+k+hiLcHNtWZHklWFIGl/IpEDTFzXThV 0Ops4Q4Aaiz2PPVzSOaqbydXV29F5Yhv8yssgdoqlfxfNMowLwFRByc6k fX+7cxBSF7muUdzCHcZfvMZegm3kSUhXQFB3B9RncfoHLa2vyZQU2W8IO Btwvi3t0uOcGtI8jIJB4vdzkj6vngS8PtN/RnjZaTuUu+yWwu0X/MAqBg A==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="3375197" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="3375197" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 06:25:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="937030146" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="937030146" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 26 Feb 2024 06:25:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 753049AB; Mon, 26 Feb 2024 16:25:16 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-rpi-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-tegra@vger.kernel.org Cc: Jiri Slaby , Joel Stanley , Andrew Jeffery , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Al Cooper , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Paul Cercueil , Vladimir Zapolskiy , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masami Hiramatsu Subject: [PATCH v2 09/14] serial: 8250_lpc18xx: Switch to use uart_read_port_properties() Date: Mon, 26 Feb 2024 16:19:25 +0200 Message-ID: <20240226142514.1485246-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240226142514.1485246-1-andriy.shevchenko@linux.intel.com> References: <20240226142514.1485246-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since we have now a common helper to read port properties use it instead of sparse home grown solution. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_lpc18xx.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c index 8d728a6a5991..e4a6b7b4caf2 100644 --- a/drivers/tty/serial/8250/8250_lpc18xx.c +++ b/drivers/tty/serial/8250/8250_lpc18xx.c @@ -92,11 +92,7 @@ static int lpc18xx_serial_probe(struct platform_device *pdev) struct lpc18xx_uart_data *data; struct uart_8250_port uart; struct resource *res; - int irq, ret; - - irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; + int ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -139,19 +135,12 @@ static int lpc18xx_serial_probe(struct platform_device *pdev) goto dis_clk_reg; } - ret = of_alias_get_id(pdev->dev.of_node, "serial"); - if (ret >= 0) - uart.port.line = ret; - data->dma.rx_param = data; data->dma.tx_param = data; spin_lock_init(&uart.port.lock); uart.port.dev = &pdev->dev; - uart.port.irq = irq; - uart.port.iotype = UPIO_MEM32; uart.port.mapbase = res->start; - uart.port.regshift = 2; uart.port.type = PORT_16550A; uart.port.flags = UPF_FIXED_PORT | UPF_FIXED_TYPE | UPF_SKIP_TEST; uart.port.uartclk = clk_get_rate(data->clk_uart); @@ -160,6 +149,13 @@ static int lpc18xx_serial_probe(struct platform_device *pdev) uart.port.rs485_supported = lpc18xx_rs485_supported; uart.port.serial_out = lpc18xx_uart_serial_out; + ret = uart_read_port_properties(&uart.port, true); + if (ret) + return ret; + + uart.port.iotype = UPIO_MEM32; + uart.port.regshift = 2; + uart.dma = &data->dma; uart.dma->rxconf.src_maxburst = 1; uart.dma->txconf.dst_maxburst = 1; -- 2.43.0.rc1.1.gbec44491f096