Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1448520rbb; Mon, 26 Feb 2024 09:31:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW0R0I1T0BEsEF2+Q24+DSYH7kCS49hzyDcZvJ1IPzSFLYJtKkXyhcyz68t712OCmcGjI4ONBlW1F5jL0ruIQb3+0RJu330E/DMlTGsUQ== X-Google-Smtp-Source: AGHT+IGobt2sB1mZRWBYz75B03rThH+3UBEkdw6OxhVCuobylX25+6Hyy+MQndH1gohfrInuKJxv X-Received: by 2002:a17:906:7c55:b0:a3e:6501:339d with SMTP id g21-20020a1709067c5500b00a3e6501339dmr5340476ejp.61.1708968712119; Mon, 26 Feb 2024 09:31:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708968712; cv=pass; d=google.com; s=arc-20160816; b=E2Sas7HGzeFPDFA+oCiuW/JltVptBUKDExhG/GxtStLwOszoZdHSle2rhafLCMyA5r LzeeCMmjLzMjTKP1B6xbGrCoRHQmBfmDkFsgHonPOQfbjdpf3RLKSup6b8QdKjmF0FW5 7VwEWpqybLPc4Me8hMcRiAv4l04tMiXyWHTVhN6cJ57VmvLrkmiOtcKJ0nwQrtTihQIo 8PjLbYQ0oMOvEWPKQBAdu8cnuMzCfWrXL95bYnwwfFL69onv8Xb9QeRwGJfgQAV5T0e6 LZr4mfjuTVY51+kmk+1yIYMfWxHZUXqKRNNLOD02WXLOfYwRxcsz2PH2q80yuOlqb/mx 805g== 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=wd2XFrM9onYe7J7z4B01h4NKcdyyYC3VwmTnsDif4J8=; fh=x+GyWh+d0fSlsBO19rBAGT/zXvddHk2lhaP+wXtmjdg=; b=zOHlCmeNkmZW0DOoLKBJTCy2b8ji6seLana6RGeX+6U1MiqyqsZt8x88/UknsCeJjm wMneWBPZlkWhC+iJbCl1pey3fYJxNJGnhs2aLt9yNzD5WDdBbv8BowROCCSuyqFnMEy2 k3X3aeQ/yaUl/ftqORYcwK2N0/ZAsc4w/YitgMI7CaIgDqsqj5mdiR1udo/HT8U4Y2VD +sg6DfRHtPXKRh/K790Cb7mwwWF1XeMaVYcZK4MkPX4rtVCkl2Rb2CdTivE3ei2lTpTs zFKYjECvBJCmRAMIM49/mZ4oT0x1BxFGDui7OTmTBgLNu3mjgy1nyLgzOP/67p1X/3lw AsGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DS+iiPGY; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81614-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 8-20020a170906058800b00a3f07f2f619si2264619ejn.245.2024.02.26.09.31.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:31:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81614-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DS+iiPGY; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81614-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81614-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5A37B1F2C6F3 for ; Mon, 26 Feb 2024 14:28:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C668812DDA8; Mon, 26 Feb 2024 14:25:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DS+iiPGY" 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 4871A12C7EB; Mon, 26 Feb 2024 14:25:34 +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=1708957535; cv=none; b=IoscVFeG+ZbZRXXFDx3YAtCm5HFCLe2tgGKcXNhcn4WfKkKrUffe/nURMDPirZwC+mtVUJDvSY3ImxphEjXHaYtgEnLH7YEm9EIKHZQyQCMB8SC167yhnhNRAUPRK6CY5o+bKpZOfyi/1l/AulfVYAFv3C1RGdLsO4YAT14qiAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708957535; c=relaxed/simple; bh=I4Dp8lscp5MpgtPKkZb6GpVT2AnT2N5Frc+xmVMhCuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YD1tv0a5RszhFEtklxmYpaC7A18jzjFCEaedQezd8TtlhoQ0xiMGOrPqT0B7r6GwxDVoISlcNvVLjr2OXuO6CKumHb+pGpLX5RPnS+HEFRN4mbZyWePUUmLB8WmmAgKm2EwsJYVQuMqyNLz2NNQOYkuI36aKx0cPzW7gz4SB1f0= 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=DS+iiPGY; 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=1708957535; x=1740493535; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I4Dp8lscp5MpgtPKkZb6GpVT2AnT2N5Frc+xmVMhCuw=; b=DS+iiPGYEWrBf4fBkiA2nJmw+2SprsezPtG0ErHNTDS2TaBTYuqgZgrp slz2iss7uupJis8aZgJpqceY1vFfMQKBRevP5CQKikENI6aBrD1m0n+I8 3tUHXzziACNIjhsSorgy4XDizzNeSH9HLTvwsMn3xsMT4Oro+6u1IAoFP KO3BouLE6nRpRGWhd/blfWtIDIk/9wxbf5EPmooLI+rryQMgdogMg0Hiv e1CgEYb5zSNACVTN2W7SNnHLvmeJzhlNddC5Uf/dDpQNdBmi5eKxA7CVb L3UnLA8IEDbwogQQ36vT1Q8HQm1QZEPvrzwYDljuzifu1PV4ozazfMWVW g==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="3375281" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="3375281" 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:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="937030150" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="937030150" 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 A3B5DA43; 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 13/14] serial: 8250_tegra: Switch to use uart_read_port_properties() Date: Mon, 26 Feb 2024 16:19:29 +0200 Message-ID: <20240226142514.1485246-14-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_tegra.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/tty/serial/8250/8250_tegra.c b/drivers/tty/serial/8250/8250_tegra.c index ba352262df75..ce48d02dfa0d 100644 --- a/drivers/tty/serial/8250/8250_tegra.c +++ b/drivers/tty/serial/8250/8250_tegra.c @@ -57,25 +57,11 @@ static int tegra_uart_probe(struct platform_device *pdev) port = &port8250.port; spin_lock_init(&port->lock); - port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | - UPF_FIXED_TYPE; - port->iotype = UPIO_MEM32; - port->regshift = 2; + port->flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_FIXED_TYPE; port->type = PORT_TEGRA; - port->irqflags |= IRQF_SHARED; port->dev = &pdev->dev; port->handle_break = tegra_uart_handle_break; - ret = of_alias_get_id(pdev->dev.of_node, "serial"); - if (ret >= 0) - port->line = ret; - - ret = platform_get_irq(pdev, 0); - if (ret < 0) - return ret; - - port->irq = ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENODEV; @@ -88,12 +74,18 @@ static int tegra_uart_probe(struct platform_device *pdev) port->mapbase = res->start; port->mapsize = resource_size(res); + ret = uart_read_port_properties(port, true); + if (ret) + return ret; + + port->iotype = UPIO_MEM32; + port->regshift = 2; + uart->rst = devm_reset_control_get_optional_shared(&pdev->dev, NULL); if (IS_ERR(uart->rst)) return PTR_ERR(uart->rst); - if (device_property_read_u32(&pdev->dev, "clock-frequency", - &port->uartclk)) { + if (!port->uartclk) { uart->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(uart->clk)) { dev_err(&pdev->dev, "failed to get clock!\n"); -- 2.43.0.rc1.1.gbec44491f096