From patchwork Fri Sep 16 03:26:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 76349 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp278242qgf; Thu, 15 Sep 2016 20:27:36 -0700 (PDT) X-Received: by 10.98.202.17 with SMTP id n17mr5874022pfg.173.1473996455970; Thu, 15 Sep 2016 20:27:35 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c73si9749967pfc.116.2016.09.15.20.27.35; Thu, 15 Sep 2016 20:27:35 -0700 (PDT) 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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757556AbcIPD1Z (ORCPT + 27 others); Thu, 15 Sep 2016 23:27:25 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34442 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757402AbcIPD1O (ORCPT ); Thu, 15 Sep 2016 23:27:14 -0400 Received: by mail-pf0-f182.google.com with SMTP id p64so22945649pfb.1 for ; Thu, 15 Sep 2016 20:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=kcYUQBdSCWtAAaZVGPzLHIQBAOHz946s5/vAKNF3FOI=; b=Xtn9ek9eXRJEIXhkIJwRFdo/0ASsSYfNg63NaOow0DnAtxCmOsojrvDDVOFR86Jf9f yv8IBNW1Vwb012sqPcHro5/a4XO48zv3RnlWWtN5Z0qCbmCH6lspnHw2NygDCx+Uw8C8 rii5cnubwwRR51RjfdCsN6rcldrGY0O5KJ+ck= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=kcYUQBdSCWtAAaZVGPzLHIQBAOHz946s5/vAKNF3FOI=; b=Kh0LTSLBkpF5j0zWN5BbEINJJz3Cdp9OTwaBoV4hFFHUAjDb59z7gnSFuYtEwazNTx gIap+sEAYEYCPB8c92EUmgKlyduvk1AtgZW9SD2xYvUgbIWkOcRt1R3Jv16RijKnuDQZ 0VbNW24DuXvCyGr74fZodbqchdrIb1Y414LviZo4DSVvVDGYyuQtnAwCuYsc7osKmpuW ht2g/MhQSRTYYdagMbWXHh7QUdds4Y0GKAstWDpLTY6a8IX8OXhutKsuA1HtnzDMaqYE LohlmKA83lG/yMWsrVIsYJOqvSPbUy/qDFNYabkk0P+IwU3uJ2YNrEcEBQeaSegWkDU7 /xjw== X-Gm-Message-State: AE9vXwOoweW/oV5taa41lDJhvhBDnb/0DDPRfpgoCGOTufX6ofbQll6FSA5vvlEEjNgB52bk X-Received: by 10.98.79.27 with SMTP id d27mr19677067pfb.127.1473996432287; Thu, 15 Sep 2016 20:27:12 -0700 (PDT) Received: from localhost ([122.172.39.60]) by smtp.gmail.com with ESMTPSA id d9sm7989782pan.7.2016.09.15.20.27.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 20:27:11 -0700 (PDT) From: Viresh Kumar To: Lee Jones Cc: linaro-kernel@lists.linaro.org, Mark Brown , =?UTF-8?q?Krzysztof=20Koz=C5=82owski?= , Charles Keepax , Viresh Kumar , patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/3] mfd: wm8994-core: disable regulators before removing them Date: Fri, 16 Sep 2016 08:56:59 +0530 Message-Id: <1ea4eed2967fd566fe0aa4a9f7a4d55083618445.1473996370.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: <7d68a9e5dd338081342dd8b06310c2f3e61fccc0.1473996370.git.viresh.kumar@linaro.org> References: <7d68a9e5dd338081342dd8b06310c2f3e61fccc0.1473996370.git.viresh.kumar@linaro.org> In-Reply-To: <7d68a9e5dd338081342dd8b06310c2f3e61fccc0.1473996370.git.viresh.kumar@linaro.org> References: <7d68a9e5dd338081342dd8b06310c2f3e61fccc0.1473996370.git.viresh.kumar@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The order in which resources were freed in wm8994_device_exit() isn't correct. The regulators are removed before they are disabled. Fix it by reordering code a bit, which makes it exact opposite of wm8994_device_init() as well. Signed-off-by: Viresh Kumar Acked-by: Charles Keepax --- V1->V2: - Added Ack from Charles. --- drivers/mfd/wm8994-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.1.410.g6faf27b diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 1990b2c90732..95e6bc55adbb 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -603,9 +603,9 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) static void wm8994_device_exit(struct wm8994 *wm8994) { pm_runtime_disable(wm8994->dev); - mfd_remove_devices(wm8994->dev); wm8994_irq_exit(wm8994); regulator_bulk_disable(wm8994->num_supplies, wm8994->supplies); + mfd_remove_devices(wm8994->dev); } static const struct of_device_id wm8994_of_match[] = {