From patchwork Mon Mar 4 12:27:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13580528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04EC9C48BF6 for ; Mon, 4 Mar 2024 12:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l4Zq/q7RY78C4LfiFNnjlIHQ7HffxOiwpVC/WOeE/F8=; b=j5WA1QMjaPWow9 vqsF8dY/iBR1gk0Lzz8onZmb62AUa1nc0nsiqBEG2pMWjeiaZ9LCI9mUbE1q+EmS2rqeEnmL915Uo oYCn8bRt5YqTwahErzzyRLmP8lzcXcvUSNRIWa1SOu/C9KVF/vjtzN3E/o2sjVsQsn0CtdV24AJzf P1124qUA07DfWOGgXmkTJ2Z7gMPicXsYZj8llKv/bXaces5gSU6CN/64w4XtXkD6ANXg8zmRfqBmA 0w0k8MKKsV/nOMn2dmpWfQEIhig/+sUUl9mwxFKFDU4O9bWtCgx/qujvn/9KOsghoEvFpLfAyEZK3 wanc7L/2H+JSCtG8wEvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7UH-00000008zhL-2r5g; Mon, 04 Mar 2024 12:32:09 +0000 Received: from mgamail.intel.com ([192.198.163.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7TB-00000008ylr-2cvG; Mon, 04 Mar 2024 12:31:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709555461; x=1741091461; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ra/vhkklVUsTKlnEDSH9uXk+a4uvGp0G/qCYEiSyYhY=; b=SmixfU9uWKSOHeweiSBN/m00HAtdevowNQXqXq8M1kGSiMQHwA72mOcr ERHB43HQVSwPvqTU+DynPR9Z7hEQ4APbCCsjlcbmBB5CdPN2xfpxvIVW1 imNJqyubQIz3HqT5VLJ+TxdnQP+aC5YjQPsXNnTOfS4AMO0yqY8gDUvNI fEFXoqwNPLZLhKeUBgxVPK+K7R5243wGBu+7WeP+7LRoyCmRHPRdDYLD1 1SwUCBhM3D8U48YCH5Fz99TwXFy/A8z8ddSxh8whlhou/aeoHj94ykwy2 iSOHDVdz/SOr2aMA5cxVvuHdOvDWU4TbhjVyoRCLaCkMBilCPEKUXjfe6 A==; X-IronPort-AV: E=McAfee;i="6600,9927,11002"; a="7815190" X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="7815190" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 04:30:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11002"; a="937040435" X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="937040435" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 04 Mar 2024 04:30:45 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id E4614BA9; Mon, 4 Mar 2024 14:30:37 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Florian Fainelli , 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 , 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 v3 14/14] serial: 8250_uniphier: Switch to use uart_read_port_properties() Date: Mon, 4 Mar 2024 14:27:15 +0200 Message-ID: <20240304123035.758700-15-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240304123035.758700-1-andriy.shevchenko@linux.intel.com> References: <20240304123035.758700-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_043101_869513_BE2333EA X-CRM114-Status: GOOD ( 14.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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..670d2ca0f757 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); + if (ret) + return ret; up.port.type = PORT_16550A; up.port.iotype = UPIO_MEM32;