Message ID | 20181205124721.26624-5-linus.walleij@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9255716ljp; Wed, 5 Dec 2018 04:47:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/XOB66WV7uViU8umTzXi3vSKAKckcjkkHPjxhBTk0sUCGNR+l9zOB9ClE9Bh5MOVrNdrJig X-Received: by 2002:a63:9c1a:: with SMTP id f26mr1787791pge.381.1544014066346; Wed, 05 Dec 2018 04:47:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544014066; cv=none; d=google.com; s=arc-20160816; b=fqCw5A8uUpzAdyp8IVKXYpyOkL9/TTQY0qvBwsRESmX9ittFprFVRsX/RFGx95AHQk qbVRAVEZHrj7BHU1Q2deh08jas4gr7O+bctTA6b8vUV0EDtiuQlmYT8+fMAE/+VSesbf daSO9oAdy5lvgy7sM/MUGg4hYpxtmYZ6hMSvVa8rqg6zCYI2//xYdh2BD8kPixrD2msU tP/88fYPZTD5L7SYhZLRXbiTrY4ABO20zZIABb79VeZxqu5BfOFqs9I9LP1eXM2vUJJw v4QhKWoUoG+UVspNS89GIGMnK5NnrgGKMm3DtCDqN2o1JO76bwmtp4sFq882g4q/OHC2 ZvKQ== 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=mRudiYan1+9SGUqT2YYA3x44wsGQ0MYaQO8d+oaHrpo=; b=FXbLFOeF+k5orx/BgHIBoWxCUDs8GqnEIuc8UwEr7VJArH7++2++h9lf50VBOTtDvb gWv6SmcvoEzMu+i+8wDKHAJPwkpU7ZqR07zOu1EBO6+uwar/0FPl/APCeNcOVvEoE19T npA+ihAWMKXaWXkzHnbNWAC6CQXu52KqwEoO5Ij8w8dylKMlIV7yhExnZw+OVg0Ad7pV CmfEuJZ3unL3M4TJsEm8OM587L4M8qXQtFeLMtb2bnKpQeo0wlhFjsV09LkMv/WJ5Eud UnrbRC3g7QE2uakoBj5X15di6hsdJv+obO6fXb4J9S1iVtOIj+NCdBj258iVR13bSYPC nmyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bk5IIEKI; 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 n5si18372865pgh.422.2018.12.05.04.47.46; Wed, 05 Dec 2018 04:47:46 -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=bk5IIEKI; 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 S1727877AbeLEMro (ORCPT <rfc822;igor.opaniuk@linaro.org> + 31 others); Wed, 5 Dec 2018 07:47:44 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35139 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbeLEMrk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Dec 2018 07:47:40 -0500 Received: by mail-lj1-f193.google.com with SMTP id x85-v6so18213188ljb.2 for <linux-kernel@vger.kernel.org>; Wed, 05 Dec 2018 04:47:38 -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=mRudiYan1+9SGUqT2YYA3x44wsGQ0MYaQO8d+oaHrpo=; b=bk5IIEKIAvyo3fv7E8AC9gwr+k7nsDv+5+bAtfzoX4iPntU0cCnQrlpAYzyFCdL1lJ s+7IgNHQHSVnlOVS7SRuV2IPPrnBrKOdOlXsKUMbAqE8TwKbaZfvnduHP4b3FFZuuBq4 XK6onBb/yZ9pXTcrQ5zudiHRqqnCNuerc+0KQ= 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=mRudiYan1+9SGUqT2YYA3x44wsGQ0MYaQO8d+oaHrpo=; b=t9enMZ12BZg7ws1wI7DS+tJIj4Zr/ovzL6KwXBIly5FYJqGwFeoImwXWibQpo137Vj i50jgkbhEj8laiDbQA7lWJeAj523AkMCMKbwdhD36K/19MqtVwhhEXe66UCPpHm5CKZj 76Arkt8h/pqnARb6JY0/6wzus+EO1rxRJ8qh9Ug/6PkzehRuJ53QdrvIaTg3NAai+c54 ASyGBdCVscUGGbO+2mW28r73P7rE6D+Ve0V+WLCRM3kcDZvx0ZPILqrK3uMMNvvX/SDr HeBYpmBjxX4WQWSSABxqLtij++3XTbmDZcdwtCNf1sRtYwnMphi6F77B/MJzfxEeY0sB VoPA== X-Gm-Message-State: AA+aEWaGZ5rU8Ts7tm7MoUzTdTqI+5sa++oi0RE3Gq4GOMMV0nSWvIgi xH9zLnAfbJkMCZTdceQCSRrDHg== X-Received: by 2002:a2e:97d7:: with SMTP id m23-v6mr3516884ljj.18.1544014058007; Wed, 05 Dec 2018 04:47:38 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e19-v6sm3797125ljf.67.2018.12.05.04.47.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 04:47:36 -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 v3] regulator: lp8788-ldo: Let core handle GPIO descriptor Date: Wed, 5 Dec 2018 13:47:10 +0100 Message-Id: <20181205124721.26624-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181205124721.26624-1-linus.walleij@linaro.org> References: <20181205124721.26624-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 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