Message ID | 20181206124351.10155-5-linus.walleij@linaro.org |
---|---|
State | Accepted |
Commit | 2bb8ede0b14187c19b5eedc62cf0b18b3bf00d3b |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp10480123ljp; Thu, 6 Dec 2018 04:45:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/X4+7/pVK7Qx0cbdEeThn/BJhGVwbalqHQ/aA9niKTikpiKXu12rkLHEWAc75hZjPYGVa6v X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr28834916plk.309.1544100319831; Thu, 06 Dec 2018 04:45:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544100319; cv=none; d=google.com; s=arc-20160816; b=EONLraLhlGYqsMeONmj8riLznNglkYC6M2OWWdv1xANzAWdhTHC5opVLAIEpWe+3ac xLz0kLDNlN3hPc7XSXSUEbtbRI7yb8rifCNVybRYGM6KjOc7/mVGCK3lOEGXG2Dx7ffF qmE3+F3hNfW3CNHu+AI93yQId520/KZP7eIh//kBlAJquvqrfQhqk4el1ad5E6VB6dL2 VYaHKWOXPGj+dC45Qp2nAcXEQ+NzPjZlJK0VT52BbX2YTXsszavQzzWIKWLlw+bDHK6b 0muLIBuJ9tHHV/rfjU/CSmNOc0rQl35iNCT8HmHJLwPJ7nfAvlGVGFa4GHJqAIXasS/F qE5Q== 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=pL3UIbDRXGJXlxTb/OqBWSX/UpAtCHnsGG4EwMeQdvI=; b=m8+waWDRK/9St7aix97yLhsseAtvn0jT5mS5GrRoC1hMnDfMVgjwU0ZlAV0v/0fJ+7 B2RTi35/19VQd6ceqIQ4p9kixHlsLjQiP1bZrbL9AgnpaEIaenkEWJgTlM3WBinqKsj8 CtgbYXptyasZWorbEye1dQR2aXqIKbs9PML5CePLwCjx9WnKga5KHXHI6srFjoaIQRtR PDPRqTw7DE/u9hon5BUIbxiqPFw0ZFYKls924b6JtHvC2srWnLKn0utUIESbUMF1cWOt XiZuSRyMO8gF4/D42StT3OSeguEHPL0Cjts75idaA1trpCmWkQWSNwXBpEgRwbfTEUWi 6xzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WyzqRLE0; 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 u3si203988pgj.300.2018.12.06.04.45.19; Thu, 06 Dec 2018 04:45:19 -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=WyzqRLE0; 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 S1729670AbeLFMoP (ORCPT <rfc822;igor.opaniuk@linaro.org> + 31 others); Thu, 6 Dec 2018 07:44:15 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44524 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729596AbeLFMoK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Dec 2018 07:44:10 -0500 Received: by mail-lf1-f67.google.com with SMTP id z13so218800lfe.11 for <linux-kernel@vger.kernel.org>; Thu, 06 Dec 2018 04:44:09 -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=pL3UIbDRXGJXlxTb/OqBWSX/UpAtCHnsGG4EwMeQdvI=; b=WyzqRLE0v9z8tUxdFVxS+i+eOALl7dl3FF9/qTkz1/Yi6jbfr2nSgpSnhDu/CFzljn JyrIpgpdfRVV8ubR7yEOB6LxStlCgsN2B9YZ45brsond4LJcNuz+x8rwgs1k5ccGh+tB 2UcaP8TZJKLDfZ883kJRQDslfQ90JMozG5eC0= 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=pL3UIbDRXGJXlxTb/OqBWSX/UpAtCHnsGG4EwMeQdvI=; b=FTo1SbYhZ+f/NNSVf1TDrYPkZ4VRIuzmB17xKynqG1xGOp7kAt5AWBT088zfZJBaw0 I7056fBZTCFy4yscfqDlidGYQzDTRFl4MeNdTD/OaC7REleP9DK1xv2/YrDvRxH3opmU bzwt4pr83b3vM679pmNw8xYFF4CjyffidJptv9N6NTjEMr46SQ7KIc/UfB0yEKrMpZeN uDesNxzqQNWdLrjtwZm8BD6LxLsMFx+JvlUYZ2txJIQMbVDdmQsqZP5V9iTPGE6PKCx/ h/uD5VxfSIhoCsHwSS1IKbWBytMlBca2hjGzf9+3QiQLmghg9Uovf/XIEfC5pmTfWybb PaaA== X-Gm-Message-State: AA+aEWaOnp4DQp78iOnf6kU264V3qKvZS337xKD8kj5cvBPR9rACebl5 8PosgHB8C/ChgLkCwgbJHxNdzLu0sidA8g== X-Received: by 2002:a19:f813:: with SMTP id a19mr16137149lff.67.1544100248276; Thu, 06 Dec 2018 04:44:08 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 04:44:07 -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 04/15 v4] regulator: lp8788-ldo: Let core handle GPIO descriptor Date: Thu, 6 Dec 2018 13:43:40 +0100 Message-Id: <20181206124351.10155-5-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/lp8788-ldo.c b/drivers/regulator/lp8788-ldo.c index 553b4790050f..2ee22e7ea675 100644 --- a/drivers/regulator/lp8788-ldo.c +++ b/drivers/regulator/lp8788-ldo.c @@ -501,8 +501,12 @@ static int lp8788_config_ldo_enable_mode(struct platform_device *pdev, return 0; } - /* FIXME: check default mode for GPIO here: high or low? */ - ldo->ena_gpiod = devm_gpiod_get_index_optional(&pdev->dev, + /* + * Do not use devm* here: the regulator core takes over the + * lifecycle management of the GPIO descriptor. + * FIXME: check default mode for GPIO here: high or low? + */ + ldo->ena_gpiod = gpiod_get_index_optional(&pdev->dev, "enable", enable_id, GPIOD_OUT_HIGH |
Use the gpiod_get() rather than the devm_* version so that the regulator core can handle the lifecycle of these descriptors. Fixes: 2468f0d51548 ("regulator: lp8788-ldo: 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/lp8788-ldo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.19.2