Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2560034ybc; Mon, 18 Nov 2019 00:41:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwaXq4+1vewgUgl5MDDHYHBPq9Sl11I3BfzCQgGDMiByr6Yru0071XUzaFBcbo0blhOFCMR X-Received: by 2002:a17:906:4697:: with SMTP id a23mr24865267ejr.322.1574066465323; Mon, 18 Nov 2019 00:41:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574066465; cv=none; d=google.com; s=arc-20160816; b=StcWjS8T/zJo4LTygl70TX245RJ4XvzgbgUAl/iPUmNY9AROPxwLedbDLMLjTLPM9Z OANenGigBp04UDxAXU6nfUhMfPS0qgxAs1Zj++D9gMbESwqTvJU/47z1xUCADiLYDoqh mbNNN4Q4u4pcCoVQb2Rm3jjKmvktvrXwsH8BnJ+tPlc2xIIwABVCqrqUh4bjN3DjiDqr kFFeB7AzP2hxj3k7A4vIWySSkUFkvVCc71BHQO1kGHvU9JJiOSKcATrkltnKAPKjkS9x XWQsnJUMkdcL3++mE2aDBdxn9fGpL9fNkJI+GfsFwxIwK/Mx6KLOKCQPHKtTcKJ3gLm6 ahrw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=D1zssAdL7pmeEJKGyrbWVna4auQ8NQ+QMvHRe4E43zU=; b=uNyJ9vZna4CtM5/66Lro+gkwubuKrFu0I5UzkDcPaFniQ+bz+BWfLWVDcVwJIAx3L4 65YIgae8Z5kN6oK3aLDLUrAYSpjE1OnhPXF+nXMvMmiIjLg7sm8GGKNxZBd3yV4Q1N1W G2E8qJCMQ4NbiMLdvw/yuzF8o2tsnJs2OVgv/1tuaKn1h0Pd1BVOyAx78DnSaQEHME1Y WCZlqB2kH9/j2200HmQ31tozsk5gBRXsTnJApglJSHjhHUrcwVsTYwzNYwGkP4Rm6r6V IyS3cBaJdyN5xyB4fpZJ8nnON5RKQ78qyrjkbEPKeCwbtoMTEzwLtH5a/yvPFwjFR5KZ 01mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=LBRhudfR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si13080012eda.278.2019.11.18.00.40.41; Mon, 18 Nov 2019 00:41:05 -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=@9elements.com header.s=google header.b=LBRhudfR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726890AbfKRIjQ (ORCPT + 99 others); Mon, 18 Nov 2019 03:39:16 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34897 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbfKRIjP (ORCPT ); Mon, 18 Nov 2019 03:39:15 -0500 Received: by mail-wm1-f67.google.com with SMTP id 8so17744723wmo.0 for ; Mon, 18 Nov 2019 00:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D1zssAdL7pmeEJKGyrbWVna4auQ8NQ+QMvHRe4E43zU=; b=LBRhudfRE6Dqy5rM35/tYO/W6FZA67rqh+c9d/WPZ7v7BAXGP6mSKGb/I3M9U+Ydyg X6wH7iqTv9ypX9aChJLlMpnBeAIRI5j34yE+BpSeymm2in1SkzxwJlqSDVeIYjMzeXOM ldGb2gLfJl2FXcYOrjSDsCT8SkJo69IjBVTX/xXmTu3YlJngqyb71GZFJpiH2G9JWnCS NKhdmOtd2hkqXkUQ7+JNFHoaT30UPld+gLtFpOWSFun/tHOghsKKaNsAJtPZJ/Ok+fl+ 4DKBLrR3jI7AU7QFs3xjCeIdEamMndxa1kPJ74Ih9u5wLQ77oSlWUiFjWyON7Q7YmqMn j9Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=D1zssAdL7pmeEJKGyrbWVna4auQ8NQ+QMvHRe4E43zU=; b=NnF1hPgjJMlvV9IfVRngbhSjmniyBB7c9Gf4elOUc2YFUvMO+WGUUElCAS4D0uLjWS 77nVkXTMv0bSlKQOsUca1+3tJxlEPinoFFHiv5oWp1kwb68I3pzmywj9eWVTC982AiF4 lUy6W4jOKjLfS5ME/AFaySKGdxBK1eX8igyf4oSTzF3ZErT4E0fOuDWGW7vwfD3te5Ks QTWy5zZLw+fizPIN2bCQtAwMP1zj50ZOpaUfzXh88lwszzTpbhZP0SpPJ+fC5Z05bViw UTEJh689s/zPzklE9WoSviBgQ7wqDVl/4/S/k8uiFcK4Kr8Yurlek6VOGsCYy0HuPGQx mVBQ== X-Gm-Message-State: APjAAAXt1GUh8BXI/zFJ7Ate0KhlG8e+uBioDT4nednjjyW0fM5FEBe0 ClzWLIpNxPwZ0h8N7tPkLIoT5u0h8HK8zml7 X-Received: by 2002:a7b:c211:: with SMTP id x17mr26192081wmi.71.1574066354338; Mon, 18 Nov 2019 00:39:14 -0800 (PST) Received: from rudolphp.9e.network (b2b-78-94-0-50.unitymedia.biz. [78.94.0.50]) by smtp.gmail.com with ESMTPSA id z14sm21700530wrl.60.2019.11.18.00.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 00:39:13 -0800 (PST) From: patrick.rudolph@9elements.com To: linux-kernel@vger.kernel.org Cc: coreboot@coreboot.org, Patrick Rudolph , Greg Kroah-Hartman , Alexios Zavras , Allison Randal , Thomas Gleixner , Arthur Heymans Subject: [Patch v2 1/3] firmware: google: Release devices before unregistering the bus Date: Mon, 18 Nov 2019 09:38:58 +0100 Message-Id: <20191118083903.19311-1-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Patrick Rudolph Fix a bug where the kernel module can't be loaded after it has been unloaded as the devices are still present and conflicting with the to be created coreboot devices. Signed-off-by: Patrick Rudolph --- drivers/firmware/google/coreboot_table.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c index 8d132e4f008a..0205987a4fd4 100644 --- a/drivers/firmware/google/coreboot_table.c +++ b/drivers/firmware/google/coreboot_table.c @@ -163,8 +163,15 @@ static int coreboot_table_probe(struct platform_device *pdev) return ret; } +static int __cb_dev_unregister(struct device *dev, void *dummy) +{ + device_unregister(dev); + return 0; +} + static int coreboot_table_remove(struct platform_device *pdev) { + bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister); bus_unregister(&coreboot_bus_type); return 0; } -- 2.21.0