Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp617691ybc; Sat, 16 Nov 2019 05:43:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwQFT7DbgJ0Rkxu84ipePQ8a5ChL72QuDcuuYboEEOCBY0/MqtqNJk8+2eDWbG+rrgcXQY5 X-Received: by 2002:a17:906:4e83:: with SMTP id v3mr9973926eju.246.1573911835300; Sat, 16 Nov 2019 05:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573911835; cv=none; d=google.com; s=arc-20160816; b=k4hLs78QPHLhL+jLinyAX+peCIveFN4iJuKdPq//RN0JMNVZCMTXrWVngD+Mg70yg+ 29oDCMfB3NSjmGHQgBQhrk7IvdjFrWdpy625lb7hvtVbTDgeVpVoXyFJ9oPczjSzzDYC 6Nc8n5qDiYDbuQ3LSJdtVB03FDkr5BaJ4XDdUSMwvPmLCN1NMOYcmE2XZLvRrYl6YcdV w/Gg4p2+YTwKn9Y18tHOom/XkG9WRbava4wLO5BxwRxYjCAhlGExSiT4n3ZxSf7eZaPu l7wBQuXZgpoZnSewlv0vTCM9LNipMsdbU2MBMkDpa+b0/8Vrt+C8c7D4/6sYhmMeMPwT j0Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pfzi9WkSDUEw46TsewAb9oPDF/5Jam4Q/nc8TvYfZ6Y=; b=agO7E3as+FlEsjRrJsEA7tZ7/bad4CGuwFbYVpDkM9cEI0EZGJqLuh/tp5MpLtKyEU NJ8u/8dx5VAtfKYgcVfpmQv36VY9L46FI7m5MirznbSdQBTHTGmgkeDSuxIQPGNlo39+ HKla5p/C/E9P5snQY+SzNgK3jfD7YuyQ5KOan4ZZcaXz5SQ2Sk4W651C851i+9qVaPLL F1V1qdHlLRhmN4r53lW29hWWBLoZI83rV9wYrG1I8u9/bYATiGwYv5raDHhRvjgUOqdY UhxK0L3oBduQpveEAedDyi7TLhP5HtAPNPKcfFuLdf7gQe8YXufFfBROeeA3BpN3LMD8 nWNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HJ+dSToq; 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 q22si7598084ejx.69.2019.11.16.05.43.31; Sat, 16 Nov 2019 05:43:55 -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=HJ+dSToq; 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 S1727677AbfKPNkE (ORCPT + 99 others); Sat, 16 Nov 2019 08:40:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:50170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727568AbfKPNkE (ORCPT ); Sat, 16 Nov 2019 08:40:04 -0500 Received: from localhost (unknown [84.241.192.145]) (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 864CE206D4; Sat, 16 Nov 2019 13:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573911604; bh=qEu1+/Og3OBtKVbdJFE+PQGreGDYeq5DFHD43HsDEn8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HJ+dSToqiKaeu8Dz3e383PGP1WmAXi10JYYiR+GO2obTqyw4VFaGcu1R61I1E2VF6 lzFQfb3o+VPhUQzZwFuoAoBbz7Ey0A4QDQ4GoWqWZKWHZ8nSF+ggTWkZ0G4HZMwugK yDNZFkp3Bg/W2lXVY9s8YYpZk0Ymm9RoM5NsV440= Date: Sat, 16 Nov 2019 14:40:01 +0100 From: Greg Kroah-Hartman To: patrick.rudolph@9elements.com Cc: linux-kernel@vger.kernel.org, coreboot@coreboot.org, Arthur Heymans , Allison Randal , Thomas Gleixner , Alexios Zavras Subject: Re: [PATCH 2/3] firmware: google: Unregister driver_info on failure and exit in gsmi Message-ID: <20191116134001.GE454551@kroah.com> References: <20191115134842.17013-1-patrick.rudolph@9elements.com> <20191115134842.17013-3-patrick.rudolph@9elements.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115134842.17013-3-patrick.rudolph@9elements.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 15, 2019 at 02:48:38PM +0100, patrick.rudolph@9elements.com wrote: > 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); Why the #ifdef here? Why does PM change things? #ifdefs in .c code is really frowned on. thanks, greg k-h