From patchwork Mon Feb 26 14:19:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 206847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2257697dyb; Mon, 26 Feb 2024 10:27:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1VLLxpILO+uTrfcXV6JOSoNeDPcXVWNu2yrOBBSzDf8lMRk2N9jHeIK3wIlMV+QldyUoizGtuFpGCAksBh1tOsY4L5Q== X-Google-Smtp-Source: AGHT+IG/YqzanshYne8FBxt7Be6ZerbPh/AvlLd7EJWsjbqfvKDBo+pWdWm334smx384bfV72ck4 X-Received: by 2002:a50:ef06:0:b0:566:2817:fb06 with SMTP id m6-20020a50ef06000000b005662817fb06mr461444eds.7.1708972021513; Mon, 26 Feb 2024 10:27:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708972021; cv=pass; d=google.com; s=arc-20160816; b=ntvkqirhBpehaRkelVsTQZBELR5CJGIEN0JXaBvGBp214F6Q642mid2szOtnQWH7LG K8jt60bXz76bIhAVTEAaGc2Vi1p7ZbhHp3l5YPG39HUqTDqTS78qz7w3zhIDHxwJuYy7 YLWHlnVMu6b3tbJ/F6japZWuCvv+CRedMOAgjlx7ugumY4lAupfHrZ+TOV3TLah328fy A1Ajp8m1qOvc8nlUX++8nUh7Qzg/Rh+fR1MpkVpjo71UCYDuvhCuzIVDXI84E4PtCFzx eHhjVn85uKGBNoTsolERV2aqAV5ufR3IsT9/b06MdDUkrDqfUocRKMXWowVJKLYT6Xqm g2mA== 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=JG1AkSUO+2scOPf8G7kcTznpAxKAt8EKp8qW9cPFQ5U=; fh=x+GyWh+d0fSlsBO19rBAGT/zXvddHk2lhaP+wXtmjdg=; b=m8upwHHgUxii8ldvHU+6lD9SMCqNq0yi9fO4Y5TJ+MgN1lFeZRIByEA/GUdXLS5bOF XGcR2Umc80Y5Jwv4AHzYuE4IlCzsdsp9KsBWb0RCXsAaemErW6NCwA8vhE/n9dyjkYoB +CBmkKMfIwNBUbD7T/8caVl6RYOAP2DwsQCnU5FmaXWS7mdzGPMZpADe7Bg0MICosvSt pyzmj+GzNZoZUjKB4U23S4hubYqQIZ9INxk2n/eSFS8n779RSPMBhVjuFl5XM1bYHXgH 9LPMZIe9OFxz0MMYhs6ORGqwCu4Wht6+VU6/dr8SNS1EMg5V60LnSs0ivYMZ4ZWSzH2N HDEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jlhVrdeU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81617-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81617-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e30-20020a50a69e000000b00565ef8ace49si1016844edc.621.2024.02.26.10.27.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:27:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81617-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jlhVrdeU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81617-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81617-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 362491F2D488 for ; Mon, 26 Feb 2024 14:29:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 618FC12F39D; Mon, 26 Feb 2024 14:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jlhVrdeU" 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 E9F3B12CDB1; Mon, 26 Feb 2024 14:25:35 +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=1708957537; cv=none; b=sOdjyCyx0ChM5mf1Ys0zrTPoa3BGK1zA6jdcQa/LK9sVYauKQpdVyBJHpAet6R6myXfIPsrbtNh7mBsJ0GrvS2CUcIHOhKSLue1gqgtgvZxBzM/FFpZ3nilcAWRtRVEXw9iswAwn19ayuOWFiXLrFgbPeb/AFDDaxP9jzM4DGyw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708957537; c=relaxed/simple; bh=lTV4RH4qiS21e5gSPVWYHbVcBJWdPYtUVhU20SXaAR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IcXETm9gu4zxUJis05XZ31tsuriiUN9rEAmnVfqQZJ5ZqkuO6Dov732TLtvBAYKxC5YQ5Rhkf2d0lnYN5X8lJa+gkbpD3/vB1ilfUiAOVz5b1V3l5QT2abT8B/mZoQb9dQPeSDoJdHvJzdlVsx82cLbFGvZ51RH+m9+ZVwC68NU= 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=jlhVrdeU; 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=1708957536; x=1740493536; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lTV4RH4qiS21e5gSPVWYHbVcBJWdPYtUVhU20SXaAR4=; b=jlhVrdeUqDSZUIRzZ6ZxKAbBNda8h+Xi4zNyKmdFtm8TevpqQB68ofRG 8WYReZzxgbv8UM3V+y9X2t7Trn0DJR1BUcQGywht2r7F98DL1BpsA/YiX 8eJZfHtIWDqSjtnl8ywMnzMA6Ha6q5mUcnKyRXXL8BnhyFp/OfueaNjA9 Q8nsP26E2hgXyMYyNFUNaF87AuZYhVdZnGRAcnzb2QZCP/f4ZmZYDmZpp ivQK/0v0YbA5mV1zxeDaHk76FoDNe8oXdfOJnxbN0t5X/UFKIEa+QoYBE M+X1We8p/5Slj4Z8I7NBGN1qpoQ6GQNEaeiUFZpfJtJpG7UqMlZ+f0gQZ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="3375292" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="3375292" 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:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="937030151" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="937030151" 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 AE687A97; 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_J=C3=A4rvinen?= , Paul Cercueil , Vladimir Zapolskiy , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masami Hiramatsu Subject: [PATCH v2 14/14] serial: 8250_uniphier: Switch to use uart_read_port_properties() Date: Mon, 26 Feb 2024 16:19:30 +0200 Message-ID: <20240226142514.1485246-15-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791987046398383470 X-GMAIL-MSGID: 1791987046398383470 Since we have now a common helper to read port properties use it instead of sparse home grown solution. Signed-off-by: Andy Shevchenko Reviewed-by: Kunihiko Hayashi Tested-by: Kunihiko Hayashi --- drivers/tty/serial/8250/8250_uniphier.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index 6399a38ecce2..d3f270a191ee 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c @@ -162,7 +162,6 @@ static int uniphier_uart_probe(struct platform_device *pdev) struct uniphier8250_priv *priv; struct resource *regs; void __iomem *membase; - int irq; int ret; regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -175,23 +174,12 @@ static int uniphier_uart_probe(struct platform_device *pdev) if (!membase) return -ENOMEM; - irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; memset(&up, 0, sizeof(up)); - ret = of_alias_get_id(dev->of_node, "serial"); - if (ret < 0) { - dev_err(dev, "failed to get alias id\n"); - return ret; - } - up.port.line = ret; - priv->clk = devm_clk_get(dev, NULL); if (IS_ERR(priv->clk)) { dev_err(dev, "failed to get clock\n"); @@ -211,7 +199,10 @@ static int uniphier_uart_probe(struct platform_device *pdev) up.port.mapbase = regs->start; up.port.mapsize = resource_size(regs); up.port.membase = membase; - up.port.irq = irq; + + ret = uart_read_port_properties(&up.port, true); + if (ret) + return ret; up.port.type = PORT_16550A; up.port.iotype = UPIO_MEM32;