Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2560273ybc; Mon, 18 Nov 2019 00:41:26 -0800 (PST) X-Google-Smtp-Source: APXvYqx189VDBDJ0HK5XfBwEag6aB5KWn5uCnENsSZMEr5tdYVTKsfw32wt72yTkM1JEfG854xYS X-Received: by 2002:a17:906:5453:: with SMTP id d19mr24107435ejp.301.1574066486063; Mon, 18 Nov 2019 00:41:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574066486; cv=none; d=google.com; s=arc-20160816; b=oWwiUNfdX78jaRTtxT3MtNSL/1aZ0jYGPIujRh7x6qqrCmK7q+e7ufrMntZBUUwISy F9I0UneW9M5PHSBM8bL5b4K/WD3ffr91tNBZMcGVartftRivU0qPv41hyZiNJKvi6hSC 5E4eCAYPJ3vYPT9JvGN0NL7phswiyPj636upTRWHppgo6/brnZGN2FzfZnWGEDi69T5a D1w86LBVmr/KTSm5DrQC3UQqMN1c4YfV44S/fMD1mxjN6Oeh/pStqd+4Fz4V4dxgzfzV iJsMo8li0ZFBn+TjaUPyv/eyGCm3YRFsD4G4BzxBwhtuoTaCF66nrIlQo+PmP6x/dkXM UjCg== 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=ph+qSnanbDkdpIO26fSuxJz1tEC79JDzqdWxgamIBpg=; b=yksIDLEFG5NpCnrislDmd2zt5O1xSiooU8M+9wGsQf72+Djs8CJP7QIG+/zaXB1zPt z6EssYWnGvVC7wB6cwms2g9We5UlGEtzgjE/9fGDPhwpAAXeH27ULZuPIqI0qh2aMKzy dCufURXbDhRhv5kk1E88kuUFQcBJnPuqUyFqPM2PszXLJeA6brkq7lTRMbsb3asfYzwg OZ0n1fOCsSatdDoiHlMQ86PQ5jnzJwnpezT6OV6noWiyJ45I1dd47cj9mw/EJMoFzJzD SWG8QRfm1OLg1b85hnQa2bvwEaMJaCfI88U6H4IpyeiI6voLmE6CA+tg4sK6IUckfPWu 23gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=QdyCU5aK; 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 e11si10519300ejr.303.2019.11.18.00.41.03; Mon, 18 Nov 2019 00:41:26 -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=QdyCU5aK; 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 S1726910AbfKRIjX (ORCPT + 99 others); Mon, 18 Nov 2019 03:39:23 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37111 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbfKRIjX (ORCPT ); Mon, 18 Nov 2019 03:39:23 -0500 Received: by mail-wr1-f68.google.com with SMTP id t1so18327902wrv.4 for ; Mon, 18 Nov 2019 00:39:21 -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=ph+qSnanbDkdpIO26fSuxJz1tEC79JDzqdWxgamIBpg=; b=QdyCU5aKOlkegIsEZLdv/OEGGK18f90hRR9Fyz1sj7ZN3IyhUGiflXw964G2k2WPC7 oaDAQ9hKT3XQdIcKhWqEJ49n40hsgzfhycERaLikcwHT22y/wHT0SxuHDMfbtQWrFvqE +5rMw3muEmYRkNEYObQoG7paBc2qgyhODaYXWYSj50eVte2t3cSD3eCTcBPCbEMUxuIw t0H1lXwyWdZr//gd0toF52gfY+P1Biv9Y2/E6UwHrAAX3IYfiMybsRPmNQMa642Y4395 oaTSg74vSz103xu0FY44V2HO4UKSTi/l3nuWdiW51Ei7AjMZZS3MUgZau21azGGqaMDf AygQ== 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=ph+qSnanbDkdpIO26fSuxJz1tEC79JDzqdWxgamIBpg=; b=Hf0+ugVu6tvOv7NyoCqjOi2nJsvTHtHozhEeeEIdyX3dEgSJMstS2hs3P2jVanTJ4I w1Anfa4DxflczuzQBb8JvNK6Sbrsq8lySBcvalT1YLrV6qhTv0n1XdT7Sj/si+yHJvij 84a139Wh3NytlmYivzI/YZnRIKkaap4DrYTnCGXZVBwSWgqoojrVNmXO/jwiOkxjuo+Q nZT14JCki5LJyYm57db3jfbc5C74gLMxE04HP7ydI29+YA4MfmD1ASmf9OOte1rLLZEt Iqd7FCR0KDQ8N4mJ3q7HHuZRSOls/CtEzGKgNhZyjgHClQPXi2rJpQJ+TQ+G/q3GGOsC 3d1w== X-Gm-Message-State: APjAAAVNE6MMnMLpRuR7pfoiITJA7L1C7qwukdOgui/TseBugSk8PZtD /useJQf/Z+P0aXzQ312JmWOPvkN4lyZBEsMz X-Received: by 2002:a5d:5306:: with SMTP id e6mr27822580wrv.187.1574066360153; Mon, 18 Nov 2019 00:39:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 00:39:19 -0800 (PST) From: patrick.rudolph@9elements.com To: linux-kernel@vger.kernel.org Cc: coreboot@coreboot.org, Arthur Heymans , Patrick Rudolph , Thomas Gleixner , Alexios Zavras , Allison Randal , Greg Kroah-Hartman Subject: [Patch v2 2/3] firmware: google: Unregister driver_info on failure and exit in gsmi Date: Mon, 18 Nov 2019 09:38:59 +0100 Message-Id: <20191118083903.19311-2-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191118083903.19311-1-patrick.rudolph@9elements.com> References: <20191118083903.19311-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 Signed-off-by: Patrick Rudolph --- 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