Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2955774imu; Mon, 19 Nov 2018 08:35:21 -0800 (PST) X-Google-Smtp-Source: AJdET5cgMXQ5J8o7+68CJmGBmYfQKbueKR4spJgLYxYp5+OoLG/ViRd2LniBLwCWoZS7IXVHYK12 X-Received: by 2002:a17:902:9a42:: with SMTP id x2-v6mr15109085plv.126.1542645321496; Mon, 19 Nov 2018 08:35:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645321; cv=none; d=google.com; s=arc-20160816; b=vzGegtN8gONCxJZ+i/vH1g6CgBAGF6wp6X7uPD666VRGV0NhnVg1ymxSoTVE64s7hP GtTTB4xQD1eOa6kTnID0NT5OXcSfOPAqsGRkuIOVughFUTnHWBHbNYIoXOUCFjC1TFmA liBIDlMWRDp4UNLSyHv9rwIsp3+5K8ThzgZBtcgnH3LqQ6Oy76KItjsma6MeeGFkYMKS 5G8cjscAmpU+DggrDYJ4B36zYmLBz5tJqYTH7GoK9Ved9lEqfm+FByv9ZhoNQY3KWlaX j7X9962solwXq0BVXK5MAXWBcT5YmtFXvKVLJRSvAyBL6wcUdo38eOoPNrEoK1tZ7ZSk 71ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/BYikOpH/KSGqKwnYS1fkamNoxUKS8c2kVpx3I9l/LE=; b=C8ZgEfoFNTXqS+cAODhjZ0JsNk9sHu11gkmdCiWORZQ9LIAmBOYhqHQsxbEa/hnBy+ +LTfvwq57hmvQdPrhevVlgyKYhv+flY5xisIRaA7qeb63bK6eiYc1q6d99H3QPLMrdwL xHAIIjnV588N5xOjoRB0cbY9fJ0alBSa5ZKqfDWCM2WKGdsB1MkdA+gI7molYIr/b2sc 2xcjCjCAeowerncq76PM6bboJa3bVMsLztuVGy0UXXC2SPhDU88qDzeQ3gVGHRaCb/Qk rJQ+CTYwqQOE/eymWKzEvTv2ot38YhZCULRHPeYSA+hEnakAcyLdWVNGpOWS5HQWItbd yfbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zJQ0Thvg; 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 f7si39954660pga.87.2018.11.19.08.35.01; Mon, 19 Nov 2018 08:35:21 -0800 (PST) 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=@kernel.org header.s=default header.b=zJQ0Thvg; 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 S1730718AbeKTC41 (ORCPT + 99 others); Mon, 19 Nov 2018 21:56:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:54658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730065AbeKTC41 (ORCPT ); Mon, 19 Nov 2018 21:56:27 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E2642086A; Mon, 19 Nov 2018 16:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645140; bh=XT0m9EPqQ7fL2Fgk9ulOB82kJflQuxCKS/w6cwajjEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zJQ0ThvgJk94dSLXNMqgheNjjBBh+ejl8uuAEe7u0izn0WG21YUSw2HJ9GnifigVw gi8VO0QcuoeLo7l6Wixst0YSwzD7y3ZcDH5QEpDVtWyxZJXj5B4077XDDFJ26J/JCO NMowE6Z2PMw4OkgkBk4OagpNsqSPU6S0VT9fBXpw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hiromitsu Yamasaki , Yoshihiro Shimoda , Ulrich Hecht Subject: [PATCH 4.19 050/205] serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout Date: Mon, 19 Nov 2018 17:25:57 +0100 Message-Id: <20181119162626.245533965@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda commit 641a41dbba217ee5bd26abe6be77f8cead9cd00e upstream. This patch fixes an issue that the sci_remove() could not remove dev_attr_rx_fifo_timeout because uart_remove_one_port() set the port->port.type to PORT_UNKNOWN. Reported-by: Hiromitsu Yamasaki Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs") Cc: # v4.11+ Signed-off-by: Yoshihiro Shimoda Reviewed-by: Ulrich Hecht Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sh-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3102,6 +3102,7 @@ static struct uart_driver sci_uart_drive static int sci_remove(struct platform_device *dev) { struct sci_port *port = platform_get_drvdata(dev); + unsigned int type = port->port.type; /* uart_remove_... clears it */ sci_ports_in_use &= ~BIT(port->port.line); uart_remove_one_port(&sci_uart_driver, &port->port); @@ -3112,8 +3113,7 @@ static int sci_remove(struct platform_de sysfs_remove_file(&dev->dev.kobj, &dev_attr_rx_fifo_trigger.attr); } - if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB || - port->port.type == PORT_HSCIF) { + if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) { sysfs_remove_file(&dev->dev.kobj, &dev_attr_rx_fifo_timeout.attr); }