Received: by 10.192.165.156 with SMTP id m28csp1115764imm; Wed, 11 Apr 2018 12:43:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx49XaJx60qLU+QErbUEkuc0w2LKBrWAhTByr3IpZhKID/dU3vtxW0qCNMQYsdCfdBBTC9je9 X-Received: by 10.101.102.211 with SMTP id c19mr4318705pgw.78.1523475834827; Wed, 11 Apr 2018 12:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523475834; cv=none; d=google.com; s=arc-20160816; b=U7IGEBacdPPMPSbNKc19uUmSew019PMLe3o4DR2VC/VXa1kya+uPBVN37ssAnwVmPi nBe6od/4GkL1NHWCIznc2ATXj7mVQWm3R2DRnHrkCHzd8bNVS/U7x+O2MuQvVR1GL3+K 4ZJ5i3k0iJSeqt7eccFuF9fzGEzDRy47ywal9XTvt8tx1s+wKNx8T547Mr776ZywoPXW ux+/urZNEZXlNpeTBukY/beymoCIuf0Y/4LvlTgJ8X0drRlgPq08z7JcDTL0T+u9SMSn dhQyST+cP32kdYk0LYGCWuMGtdIFeVclKv+9VzHcoT2bXHizBEPW/4UdlHVCmR0yJnH8 duHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2zLNpTn03kmoYJWtOID09fA0BOxCFrvOohmL9ash+4M=; b=Zy26vVBI5Tuyb1h/VtFqLAwzqHQpMr0ljsxl0hjvfMY+1Rzzo7QIsZZZgBwewCbjxu /KZiQXPhvYueAhLPkVPxirKJmsiTRASh+vAycx6klO3nhYtjOQtKWzdbCSZcEu3zVa6K EAou1aj6ZJq+Z7yqylxU79IfliVGlH8fsq68dbOp+YlzqG64BYsIaggpHyMLy0afQUH6 yY323d706mgZuBNPpl9rIqu48UXYrMS/2Nn6Kh4u4hL+cvBgX/EbRDgkcRAI/hCm/IBe wf2+BgP55dZVxRO90LNEC/3V5uPvSwmAhW2iikzaG29D3/gaZV+8Ovc9ChSdCLgKfi+V e8xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i72si1149963pgd.705.2018.04.11.12.43.18; Wed, 11 Apr 2018 12:43:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757309AbeDKTkf (ORCPT + 99 others); Wed, 11 Apr 2018 15:40:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38058 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934191AbeDKTBJ (ORCPT ); Wed, 11 Apr 2018 15:01:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C22A2DAC; Wed, 11 Apr 2018 19:01:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King - ARM Linux , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.9 187/310] Fix serial console on SNI RM400 machines Date: Wed, 11 Apr 2018 20:35:26 +0200 Message-Id: <20180411183630.655942922@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Bogendoerfer [ Upstream commit e279e6d98e0cf2c2fe008b3c29042b92f0e17b1d ] sccnxp driver doesn't get the correct uart clock rate, if CONFIG_HAVE_CLOCK is disabled. Correct usage of clk API to make it work with/without it. Fixes: 90efa75f7ab0 (serial: sccnxp: Using CLK API for getting UART clock) Suggested-by: Russell King - ARM Linux Signed-off-by: Thomas Bogendoerfer Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sccnxp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -884,14 +884,19 @@ static int sccnxp_probe(struct platform_ clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(clk)) { - if (PTR_ERR(clk) == -EPROBE_DEFER) { - ret = -EPROBE_DEFER; + ret = PTR_ERR(clk); + if (ret == -EPROBE_DEFER) goto err_out; - } + uartclk = 0; + } else { + clk_prepare_enable(clk); + uartclk = clk_get_rate(clk); + } + + if (!uartclk) { dev_notice(&pdev->dev, "Using default clock frequency\n"); uartclk = s->chip->freq_std; - } else - uartclk = clk_get_rate(clk); + } /* Check input frequency */ if ((uartclk < s->chip->freq_min) || (uartclk > s->chip->freq_max)) {