Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5051373pxu; Thu, 10 Dec 2020 11:38:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlRLIYEi5PFD6k4sOkHQfi88HKgB4Z85dU1aSuZGSrdS8iYWL5+tH7cB36RK63iZVQL74v X-Received: by 2002:a17:906:b79a:: with SMTP id dt26mr7574998ejb.337.1607629120384; Thu, 10 Dec 2020 11:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607629120; cv=none; d=google.com; s=arc-20160816; b=tp9dasdykfHd+l996dR0n1A927InVPuFuymsY2jaJ/fFQUsiCNcgTxRFSkoGmQHe/L rf/4x6YvnqjaC9ot/O0m4C70favALH/hVK86z85pCDDDbuLKdj4aYcwlJxDQUJzC/8Ii rq7bmdP2elLx2HSf0Y39WTYl8BXB115FJYCLlP07dr1c1k6Ze/vIy0s1qK+PT1JMTsAb 9wfVhl4euR3M2kM0jp8rAwp9OsTli5EDLU5YIRqY91279Lp6fjWr38zL6bBMPzQ8+ONf qgwnGxQw0q1MuJgYcwrr2eFuLLaGHSYlZ5Dc62L/kWplBzpGcnJ/YIyVpBVmmHBgaXF4 1kgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=th2v5jsLvT9su8lReZ88A+LQGVYx/hoxX9c0iBbG9dI=; b=fiiAZvNfVvB8urAw+lz1ErfKz+qTzReA7qq8b01s9MgKAn5/GlrozhkuQ6LFIqDFyE yHLWF8PBH9sU0/+59S4oN53XyzJJEWpEkB34mHu42Xq122YyBBELLQix6VatYYTnGKct OWRm6Dg4ENKEKY8fgg/5NpG3ckxl/ge+QWb1ZmykO0Ozh6BWjBDLZlmN+hBwGiN5g/VR TC6lqf/qjkCBjuUWFJ74IQoKDcYBLkdMHH4qqpi1W0+zYOkt2gKOMEzIVV9NtRsVfvQO Yj79HMT22k+8XCBfHjneijcWuxkqW6i/uLVkWAvM3fBhDpgQlYonAaqu93Rn6i4doDzi hYlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si3221008ejb.180.2020.12.10.11.38.17; Thu, 10 Dec 2020 11:38:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404247AbgLJTeP (ORCPT + 99 others); Thu, 10 Dec 2020 14:34:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:37480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390227AbgLJO32 (ORCPT ); Thu, 10 Dec 2020 09:29:28 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, chenwenyong2@huawei.com, "zhangyi (F)" , yangerkun , Lukas Wunner Subject: [PATCH 4.9 15/45] spi: Fix controller unregister order harder Date: Thu, 10 Dec 2020 15:26:29 +0100 Message-Id: <20201210142603.116258683@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201210142602.361598591@linuxfoundation.org> References: <20201210142602.361598591@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lukas Wunner Commit c7e41e1caa71 sought to backport upstream commit 84855678add8 to the 4.9-stable tree but erroneously inserted a line at the wrong place. Fix it. Fixes: c7e41e1caa71 ("spi: Fix controller unregister order") Reported-by: yangerkun Signed-off-by: Lukas Wunner --- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2025,13 +2025,13 @@ static int __unregister(struct device *d */ void spi_unregister_master(struct spi_master *master) { + device_for_each_child(&master->dev, NULL, __unregister); + if (master->queued) { if (spi_destroy_queue(master)) dev_err(&master->dev, "queue remove failed\n"); } - device_for_each_child(&master->dev, NULL, __unregister); - mutex_lock(&board_lock); list_del(&master->list); mutex_unlock(&board_lock);