From patchwork Thu Sep 15 11:17:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 76271 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2381576qgf; Thu, 15 Sep 2016 04:17:21 -0700 (PDT) X-Received: by 10.98.198.85 with SMTP id m82mr13592344pfg.3.1473938241802; Thu, 15 Sep 2016 04:17:21 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si3796902paa.285.2016.09.15.04.17.21; Thu, 15 Sep 2016 04:17:21 -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 S933571AbcIOLRT (ORCPT + 27 others); Thu, 15 Sep 2016 07:17:19 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:33029 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933195AbcIOLRS (ORCPT ); Thu, 15 Sep 2016 07:17:18 -0400 Received: by mail-pa0-f49.google.com with SMTP id cm16so15212596pac.0 for ; Thu, 15 Sep 2016 04:17:17 -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; bh=vcbipVJ2hG3jFsGdH8SuMEikrG8U+/K3O3z1W1hWl0E=; b=Ots0vTKi65fll4+4QGLhypWmWTzOteVB6+U/sdK8U6PoBCFpkHxIxaN/AOqA9rWnQe lJqG3ojhpWkXsE7DSlRTJcOMp8NvXesD2hqygPXGejHTW66eHbWgvfA9RxSYnqwwGATX +pM14gc7m3e7uVlornpyUmf4pIyWv4v1gD/OE= 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; bh=vcbipVJ2hG3jFsGdH8SuMEikrG8U+/K3O3z1W1hWl0E=; b=PxzEZV0A/BP6l+EFpAUJK2V9GUZYzmpZHPb+irws8aq6X0oBkVu0JpODTOXzDikuzw eudq+dLbmWg/JoSs9I0WRqkP4BZLn5vC9Fd6QPaO7XE/yuWmiRRdypdH2tHHrvDo6d2a AL5kJpUJ7Hd2xVSo590AC6Ai+fPBt8hUkMPM9xIUDqHWY86fMMWtumShFMYh+ugY9bQ3 L4zMzysU7+AZmWjktFMfIi/o7N5YPK8IEeDIMOOpsVtVgiWUJpCB+hxz3ibmdL1ZQi7Q YdfVsXh+285r5UoaQKDeAuivqRH7wZjIILPlOfNecjZcKuHqENBdMbOIqbfn8BKSE1fh eOXQ== X-Gm-Message-State: AE9vXwNyyZMRU+57oFBVYCpe3JLXNu2uFLbK3wuMMZJ0bEOzutkZZosgKvrgtyyoN+hxxhLc X-Received: by 10.67.23.201 with SMTP id ic9mr13758667pad.143.1473938236966; Thu, 15 Sep 2016 04:17:16 -0700 (PDT) Received: from localhost ([122.172.39.60]) by smtp.gmail.com with ESMTPSA id ra13sm4487092pac.29.2016.09.15.04.17.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 04:17:15 -0700 (PDT) From: Viresh Kumar To: Lee Jones Cc: linaro-kernel@lists.linaro.org, Mark Brown , =?UTF-8?q?Krzysztof=20Koz=C5=82owski?= , Viresh Kumar , patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mfd: wm8994-core: disable regulators before removing them Date: Thu, 15 Sep 2016 16:47:00 +0530 Message-Id: <9f4aa8441344137272549e65d81c7fe65e37a8a8.1473938123.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b 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 --- 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 7eec619a6023..1e644aa53a2d 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -604,10 +604,10 @@ 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[] = {