From patchwork Tue Aug 8 13:48:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 109662 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2974912qge; Tue, 8 Aug 2017 06:50:37 -0700 (PDT) X-Received: by 10.84.215.204 with SMTP id g12mr4762112plj.397.1502200237571; Tue, 08 Aug 2017 06:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502200237; cv=none; d=google.com; s=arc-20160816; b=ho21Iy3wjK5kH84WtosItE2ISrdT6kHvk9PPmH+ajnrNh+/VES7paGmB9gHHDtEAdu K4t3mfWNoAAdRdNIl5KQv3TBtWbzSvCcpcx7prClAGwGH4yQHXpVDxcrAQJhWNC95SgK cJWTlBduju9RYjUdORr+hbB7TnZTZe4U90rmK9beEoz7ojDyE7NXY1yCvH2N2jFbZdBJ hUM+511rw8axYCmprOQGGdSJ/a3HaqwAXXcRZDLEt9TnyBB04SLgcWDeIZ0JjLrDWF09 marOe+wRW3fD8Gj94Zs5u0/Z3ad1Nx2G6uedBRySngKk1wrqiz1FBNAYyfoqdl/xonvn eYSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=TD7haFq2H+BfKfnMYM+1QMIYrzyoEAlL+Zqu0/as2ow=; b=WeSV9QdsBg6er7l7HQheDi7nYAjuNvQppKI0Sac70JFiI0IVhy5pwadZQDJotihsx/ xVJoR6FuA3x5ipMRRdsTNDjKIXSgaV9kI4s/AvqxeyZAO53647Q1MzOgJSGnOeJeXCjh MXPuijufOdTOBKeY0x2ETex9CCVhRqwUkROJMIXHIAKN2TMM/JA4FEEKP9gdBzEpMdWt Dan3h9n9iocQZefj4GS7BFd8OceYcKxD6vLGJZSBrl24yr0+KllIixH5KWX9Ab8ve1UE fRGqxlGhwvVrqMNahFNRUO8/0GM/Xhs79hihC1xPr0R6CoScauCwpD6bH+sC1QPVzS/P LAUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=T3hnm2p5; 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 y126si836396pgb.152.2017.08.08.06.50.37; Tue, 08 Aug 2017 06:50:37 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=T3hnm2p5; 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 S1752278AbdHHNuc (ORCPT + 25 others); Tue, 8 Aug 2017 09:50:32 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:61491 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752070AbdHHNu3 (ORCPT ); Tue, 8 Aug 2017 09:50:29 -0400 Received: from localhost.localdomain (pw126245200194.16.panda-world.ne.jp [126.245.200.194]) (authenticated) by conuserg-09.nifty.com with ESMTP id v78DnDns010873; Tue, 8 Aug 2017 22:49:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v78DnDns010873 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1502200155; bh=TD7haFq2H+BfKfnMYM+1QMIYrzyoEAlL+Zqu0/as2ow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T3hnm2p5yCeMkYIInOt0xa0tiOik9pRRgNowGMS2S/VJFYxfEneEwkVrCotQyTxfM ooXwFqNtZn+IW2cUv0jlICHuQPK89syB8Ip3+EuDIolSA51RctxGTMWvskdyxbFjnv 7N9oHWYu4NX+/MjvPWgBjzZ4agmCYzKEecWE5dmYyDE/BS4zBFxKfrPNd32j30C/tS qp3s41sJYbD05h4XFcvIoSpPH5S+H2z5vGC6/svrST3d+saTuLoJqIUhWw7bCRjTll OuK5d0HnaUdmrvayPvU66B1gC8Sr8wRwGdP4cCEDQL+TsroCd0+JzxlcnCbuLX91AQ DAN2zPWKMikvw== X-Nifty-SrcIP: [126.245.200.194] From: Masahiro Yamada To: linux-serial@vger.kernel.org Cc: Masami Hiramatsu , Jassi Brar , Masahiro Yamada , Jiri Slaby , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] serial: 8250_uniphier: fix serial port index in private data Date: Tue, 8 Aug 2017 22:48:41 +0900 Message-Id: <1502200123-2558-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502200123-2558-1-git-send-email-yamada.masahiro@socionext.com> References: <1502200123-2558-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org serial8250_register_8250_port() may allocate a different port index than requested. The driver needs to remember the returned value of serial8250_register_8250_port() for later use. Otherwise, the .remove hook may unregister a different port. Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver") Signed-off-by: Masahiro Yamada --- drivers/tty/serial/8250/8250_uniphier.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index 746680ebf90c..633ac378b7f2 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c @@ -169,7 +169,7 @@ static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port, dev_err(dev, "failed to get alias id\n"); return ret; } - port->line = priv->line = ret; + port->line = ret; /* Get clk rate through clk driver */ priv->clk = devm_clk_get(dev, NULL); @@ -249,8 +249,8 @@ static int uniphier_uart_probe(struct platform_device *pdev) up.dl_read = uniphier_serial_dl_read; up.dl_write = uniphier_serial_dl_write; - ret = serial8250_register_8250_port(&up); - if (ret < 0) { + priv->line = serial8250_register_8250_port(&up); + if (priv->line < 0) { dev_err(dev, "failed to register 8250 port\n"); clk_disable_unprepare(priv->clk); return ret;