Message ID | 20181206124351.10155-6-linus.walleij@linaro.org |
---|---|
State | Accepted |
Commit | 894077d5c871f86e6c88a70ac016b6811a910b23 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp10479238ljp; Thu, 6 Dec 2018 04:44:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/WRa7t5ubDJW2EBAya8xhD89w1siK0NLP1/gfhJ285fQZ5UH9pv9G+Sf0yeTwoP87iYe2Jx X-Received: by 2002:a63:1f1c:: with SMTP id f28mr24046100pgf.193.1544100257069; Thu, 06 Dec 2018 04:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544100257; cv=none; d=google.com; s=arc-20160816; b=c7hZCr7k3ooXV03D1loYzoBpk7dMOQohW1vU4hqUad2AuCKxJb/uSN9e6Lt0I9AHFP 4xRxNqgmIbx8rnYA2dGdM07IP0LKJIPqZo+V6gsd5l83RhcXkqBRZ7VYQzdUtC5ukBo3 pLJpVrYg6Cv3fwAoj8JYsw5MtIgbziPkV4MayQ2LeJrsVPJaVeYLWHqKlDaT/jlSa+DZ yewFoQiAB523suMuNNcfoiJrNcMtmiJ37J1iEvm8tBrbzR0MfwzxEjvCKeF2EVPUvg9d 2jB3f7ao0SI3lIpD4h3JCOyqiubS+hwNs06z/zz6k5FWUX8Pjnog1xwjP+0cwufdfuWA zkgw== 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=x/2aw+P83R8elX2tp0ut9Zm1k1q1tBogpgmcBikeeU0=; b=hpfmoqTXFnaHfKwQ//Sxruli+7OKMtcMCiukeAKK9Cm8Azzn+wn6xeGt1vWWokC5D1 quM/KJTxDlKf0jeaPpTbGA0RQSk+FKhJMEpycFOzuvoCwrVw3PAr45uKsd+r2Qvi53l/ 43quQxfnTh1rFqfxyWz2iKtcT58eMGmEPv7nf3sh+6Be/7rnDqCNptmTdbyppCQlfMLh AdwgOIBkmbVTR0omqg/EZBXw6mAqOTBKekBfkSGlieSb3/6CCIzmi4Gi0waiyYei0mtq qAGe56VZfrnLMOLqF7Woer4Fuo4KkZ5YbVPfm1zlTIQItG1Q/ZkPHcmNqcpATt9oWu+A YyZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ui+zLHTp; 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=linaro.org Return-Path: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p17si201618pfk.275.2018.12.06.04.44.16; Thu, 06 Dec 2018 04:44:17 -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=@linaro.org header.s=google header.b=Ui+zLHTp; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729527AbeLFMoQ (ORCPT <rfc822;igor.opaniuk@linaro.org> + 31 others); Thu, 6 Dec 2018 07:44:16 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46785 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729650AbeLFMoM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Dec 2018 07:44:12 -0500 Received: by mail-lf1-f65.google.com with SMTP id f23so210797lfc.13 for <linux-kernel@vger.kernel.org>; Thu, 06 Dec 2018 04:44:11 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=x/2aw+P83R8elX2tp0ut9Zm1k1q1tBogpgmcBikeeU0=; b=Ui+zLHTpafJQyKa25wAkhePyr5xNBilE4jN/WQ5QNhqvVoUhFUlI+0sqFvLIkJgkO7 dLTgZ5hYpqbBTZn5nW1g9hv8hIEiMMEDzqCzTwOr84M/mOZTxO2jtqHfiz5lA/uobIvF uiCu+ZDPRzEQKcSvRxzpJSx7ACOsr8+8fV87Y= 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=x/2aw+P83R8elX2tp0ut9Zm1k1q1tBogpgmcBikeeU0=; b=dA4zGxaF+KuYrinVzgm5RYz40zz/zDoTmwndW461y3bsQF1sH2r7xUlEvIFH433Hl+ YN5moL7PsuTJjn0Xz/1+eIKoWkGId+3P1623YxCGJ0i+1f4XhQDJf+EXNZZBM6lcm83C Hv5q7Uw2252M6mhmIG19CX/BRcF/lJD34f8u1vVdzwbNBAGR7Q4m/QjQmjzsmmNecMwj Aru6v6BtDBn5eJpbgPF3itmkess32Tl2yro8MY6N4eE6nnPekECQw0tChMRbLBcxKyIb lB51YZc++MiCePqw2LMrc3bSEC0vLkWsmyXp9S7w1/h4BoLigfAqe9u7HnHw9NoQzelu lILw== X-Gm-Message-State: AA+aEWa4WNL0Ne0BSxJ1GZRqG87vifEM7pIZ3yHJ4sCgl+0e8MQLFyLf 2pIX0FipfmA8iFLM9Rae6jQ2HA== X-Received: by 2002:a19:d857:: with SMTP id p84mr16351987lfg.44.1544100250347; Thu, 06 Dec 2018 04:44:10 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j25-v6sm44071lji.77.2018.12.06.04.44.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 04:44:09 -0800 (PST) From: Linus Walleij <linus.walleij@linaro.org> To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org> Cc: linux-kernel@vger.kernel.org, Charles Keepax <ckeepax@opensource.cirrus.com>, Bartosz Golaszewski <bgolaszewski@baylibre.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Linus Walleij <linus.walleij@linaro.org> Subject: [PATCH 05/15 v4] regulator: max8952: Let core handle GPIO descriptor Date: Thu, 6 Dec 2018 13:43:41 +0100 Message-Id: <20181206124351.10155-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206124351.10155-1-linus.walleij@linaro.org> References: <20181206124351.10155-1-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
Regulator ena_gpiod fixups
|
expand
|
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index 6c39fff73b8a..cf2a2912cb1b 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c @@ -231,9 +231,13 @@ static int max8952_pmic_probe(struct i2c_client *client, else gflags = GPIOD_OUT_LOW; gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE; - gpiod = devm_gpiod_get_optional(&client->dev, - "max8952,en", - gflags); + /* + * Do not use devm* here: the regulator core takes over the + * lifecycle management of the GPIO descriptor. + */ + gpiod = gpiod_get_optional(&client->dev, + "max8952,en", + gflags); if (IS_ERR(gpiod)) return PTR_ERR(gpiod); if (gpiod)
Use the gpiod_get() rather than the devm_* version so that the regulator core can handle the lifecycle of these descriptors. Fixes: d7a261c2d1f2 ("regulator: max8952: Pass descriptor instead of GPIO number") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- ChangeLog v3->v4: - Resending. ChangeLog v2->v3: - Resending. ChangeLog v1->v2: - Drop the gpiod_put() on the errorpath after devm_regulator_register() as this will be handled by the regulator core. - Put a comment in the code so maintainers knows not to use managed resources (devm*) --- drivers/regulator/max8952.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.19.2