From patchwork Tue Jul 1 11:55:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 32886 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CC12E20672 for ; Tue, 1 Jul 2014 11:57:36 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf60322281oac.3 for ; Tue, 01 Jul 2014 04:57:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:date :message-id:subject:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=FRplTFFs/NQCg42ZnriE5BG2LRK4mDeAjhDVcrueM4M=; b=clvqVj25wyMoqMDOTnaJ9jGE7U80RZIzdlVd534O66Fv6Km1EnvRuEbuZs5Q0gpVfy UnwuaR7xHZdeGPB9gwx9h9VE4aihwjACPkAsn/F5clxbtIZCniaGPNIg4miFagE/NKQE l+4AeYONku+5nIC9KRuoWgU1RxtlDhkOpS3t35mRIq5lePaA6WBaM/C8X6u6rTwBMiyz X9LoAGidlHsOul4Dws5wpj0VsPRicw+fVmwHP3qsJ2iISriggquqT18d3n1gYpkT0v3B bk8s0DbpoD4QF2l5sIW0Of7hs6Zm3ewWOVAK6RYEi9JjJh5hLXPt0k361GYWZbArNuqr kPmw== X-Gm-Message-State: ALoCoQnVpB/oZWb/cjMG7b+yPPlBSqGXjM1uEWcWhvo3AvUG/veR6as4I8PD6IKr007LNNcGy2iv X-Received: by 10.43.12.67 with SMTP id ph3mr23244225icb.28.1404215856378; Tue, 01 Jul 2014 04:57:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.193 with SMTP id q59ls1944612qga.91.gmail; Tue, 01 Jul 2014 04:57:36 -0700 (PDT) X-Received: by 10.52.135.226 with SMTP id pv2mr36598216vdb.33.1404215856119; Tue, 01 Jul 2014 04:57:36 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id xx2si11278945vdc.54.2014.07.01.04.57.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 04:57:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ij19so8844069vcb.37 for ; Tue, 01 Jul 2014 04:57:36 -0700 (PDT) X-Received: by 10.58.234.199 with SMTP id ug7mr239789vec.40.1404215856025; Tue, 01 Jul 2014 04:57:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp209116vcb; Tue, 1 Jul 2014 04:57:35 -0700 (PDT) X-Received: by 10.68.213.34 with SMTP id np2mr13633991pbc.167.1404215855247; Tue, 01 Jul 2014 04:57:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc4si26739489pbb.71.2014.07.01.04.57.34; Tue, 01 Jul 2014 04:57:34 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751973AbaGAL5Z (ORCPT + 27 others); Tue, 1 Jul 2014 07:57:25 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:42575 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbaGAL5Y (ORCPT ); Tue, 1 Jul 2014 07:57:24 -0400 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante.sirena.org.uk) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1X1wgI-0005T2-7t; Tue, 01 Jul 2014 11:57:06 +0000 Received: from broonie by debutante.sirena.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1X1wgD-0000hb-Ug; Tue, 01 Jul 2014 12:56:57 +0100 From: Mark Brown To: Liam Girdwood , Linus Walleij , Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, Alexandre Courbot , Mark Brown Date: Tue, 1 Jul 2014 12:55:26 +0100 Message-Id: <1404215726-2480-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.0.0 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH] regulator: core: Still free GPIOs using gpio_free() X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: broonie@kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Brown Even though we mostly use GPIO descriptors internally we still use gpio_request_one() to request so we need to pair that with gpio_free() to release the GPIO. Reported-by: Linus Walleij Signed-off-by: Mark Brown --- drivers/regulator/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c563d93125cd..80381409f856 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1710,7 +1710,12 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev) if (pin->gpiod == rdev->ena_pin->gpiod) { if (pin->request_count <= 1) { pin->request_count = 0; - gpiod_put(pin->gpiod); + /* + * Since we requested with gpio_request_one() + * we still need to free with gpio_free() + * for now. + */ + gpio_free(desc_to_gpio(pin->gpiod)); list_del(&pin->list); kfree(pin); } else {