Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4506650ybc; Fri, 15 Nov 2019 05:52:25 -0800 (PST) X-Google-Smtp-Source: APXvYqz4H5Mft93cpP1QRG6J7QSDP9kVe3ByLYQ8YcDFIEIOaeak0Oyu8O1XhXqfKYUJ9hZr+nM7 X-Received: by 2002:a05:600c:2102:: with SMTP id u2mr12260130wml.49.1573825945095; Fri, 15 Nov 2019 05:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573825945; cv=none; d=google.com; s=arc-20160816; b=SWnOg4LXG1jdI/YGlxIO77wd6woA+SCQ3nJqBHX759WChhqwmEzEML2j1dkyEPB7RL 5ugYE7HnypXZ5/zzIT7RQXFi6LrHJZYo1O9SImXPo8VtkVwBAu7ysy/5A6gpu3dOi6/N rlcJZ+AYBGAwRyp2Ar5M6jj7/MAoNl8cAb+aLICJ6sR/zlgrqILkjBk9s466q4eO4RJK 50oO3UcZNrev/3tmXktjdHfXhBdszbdR79JQQTuY55HOcUpoPKu+HvpgXKqbvgjh2gmP 1TWFLvAFGzVp73oZcSQCq3bPvXSrAIOxAnU+o194hrfiYuHo7aujG35O9pvCEcoW4mvl LXUg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jPqNE1lV8uNU1HbMJqXHuF3ifYmkzeAOvJ5fb7/933k=; b=H9wOIh8Ab2Ak6y9YqVcoR67SpxCJvG8oof4AVPSeC/HOe2Zyop1Tfi+Av9epJu5Zi8 NPNxfrQ7R7U8bMtiywYmYqrclSYRVIQ/ZQ/dOyV0q1mqWiIwjE+anU/M8Z0MrEyhCqZE N/wnyBnTjH8Iq1x6712kQ7DdbTGRhgbNsSpcT1iJs4iwGw2jNQ8Txuef2qDCD3U8Eec6 spZY4tUDvMxvH+Xlb0zTcnJ/RRIArhYiLrBaGrgP1JCakVI1zrUmyyLqsVSHnc8S97MW hHdPzOP4fj7jntSuaWuaM0+PwcLrN/7mSPNpr4pJSCzWymsVFYqGmXmDKq72gRJyhBjI yneQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=endDTSGS; 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 g7si6149441edg.66.2019.11.15.05.51.56; Fri, 15 Nov 2019 05:52:25 -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=endDTSGS; 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 S1727656AbfKONuO (ORCPT + 99 others); Fri, 15 Nov 2019 08:50:14 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34577 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbfKONuN (ORCPT ); Fri, 15 Nov 2019 08:50:13 -0500 Received: by mail-wm1-f66.google.com with SMTP id j18so10128088wmk.1 for ; Fri, 15 Nov 2019 05:50:12 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=jPqNE1lV8uNU1HbMJqXHuF3ifYmkzeAOvJ5fb7/933k=; b=endDTSGSky7hbBNeTk7jcQHKgzocmhMhKiLsy0ZeFyqEbWBbvi046QWG8cziJXo+SW SjwVBDTXo4H95dWmm2Wf8d0PyontBgJfMxaRroO7285v3bhm2ifTCAEs+i2pCS1jGbVw 7GClakov3mX5mcshD2LS4Y03ID81rz/CmUXj4FegY0UFhHX0nXc5/5MwhTXikPJ89o3P +c3XHE2vNYU0gHxDwNeKvcrq92qs3NfZv9rsnS75bweNMlLay5LqqYytrnZyorS7UthD J/nR5eLY84EMs0P+Xeni4cebOi2QRgXx1d51SMDlXs99u3ALlkdnbvclBfBXbfNjp4SX eFdA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jPqNE1lV8uNU1HbMJqXHuF3ifYmkzeAOvJ5fb7/933k=; b=qUlq3R0UWdLY1WrlbDZeApn6EBaIW1ANyedQZyB+OuA+okkQMVjy4+tm2m0YuU9o8V 0qHhNbow3Jbxwe8smImg57qduH1zpl6XcJak/Ebz1eWTLlGEiJzhkf7FsMovH9o/XwuT ubMoq8puHNQxfS4WgHznPg3T29x4KUe+iFvzV/2i350wXUtPIZcssbBf5qcUvIeEJ/eW wCr1QjoKEpFmBotpnT4fZSWilz7liR+hbWwqkOG/9VSlK/2CHsoQPNpI/Bn0jHANTfOY utIG2jESHgZjdH3frKUrgqs5hwjtWXblDj7YOOMJs/hOFjOA/xTQSSABQ6jv5MAWlbhL FONQ== X-Gm-Message-State: APjAAAVEeHIwYyFA4F//nH0Y5GSGY71Jlb0FppeHyBdkiemk2I4mmlrY wzpekqEoruuIR4tOle/x+GEVbAzZAO7XMZI9 X-Received: by 2002:a05:600c:296:: with SMTP id 22mr14863930wmk.155.1573825811247; Fri, 15 Nov 2019 05:50:11 -0800 (PST) Received: from localhost.localdomain (ip-94-114-101-228.unity-media.net. [94.114.101.228]) by smtp.gmail.com with ESMTPSA id f14sm11119906wrv.17.2019.11.15.05.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 05:50:10 -0800 (PST) From: patrick.rudolph@9elements.com To: linux-kernel@vger.kernel.org Cc: coreboot@coreboot.org, patrick.rudolph@9elements.com, Arthur Heymans , Allison Randal , Thomas Gleixner , Alexios Zavras , Greg Kroah-Hartman Subject: [PATCH 2/3] firmware: google: Unregister driver_info on failure and exit in gsmi Date: Fri, 15 Nov 2019 14:48:38 +0100 Message-Id: <20191115134842.17013-3-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191115134842.17013-1-patrick.rudolph@9elements.com> References: <20191115134842.17013-1-patrick.rudolph@9elements.com> 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: Arthur Heymans Fix a bug where the kernel module couldn't be loaded after unloading, as the platform driver wasn't released on exit. Signed-off-by: Arthur Heymans --- drivers/firmware/google/gsmi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index edaa4e5d84ad..974c769b75cf 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c @@ -1016,6 +1016,9 @@ static __init int gsmi_init(void) dma_pool_destroy(gsmi_dev.dma_pool); platform_device_unregister(gsmi_dev.pdev); pr_info("gsmi: failed to load: %d\n", ret); +#ifdef CONFIG_PM + platform_driver_unregister(&gsmi_driver_info); +#endif return ret; } @@ -1037,6 +1040,9 @@ static void __exit gsmi_exit(void) gsmi_buf_free(gsmi_dev.name_buf); dma_pool_destroy(gsmi_dev.dma_pool); platform_device_unregister(gsmi_dev.pdev); +#ifdef CONFIG_PM + platform_driver_unregister(&gsmi_driver_info); +#endif } module_init(gsmi_init); -- 2.21.0