Message ID | 20181205124721.26624-6-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-v6csp9255768ljp; Wed, 5 Dec 2018 04:47:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/U15ffG+OsPXXz4QF+xcQjDn9doI2eNQnR/5DZA8nhHW4tF39P2EZV0tqak1kU9wQ0JqRzi X-Received: by 2002:a63:a112:: with SMTP id b18mr20519600pgf.440.1544014069394; Wed, 05 Dec 2018 04:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544014069; cv=none; d=google.com; s=arc-20160816; b=O8SpRXmjK+IPyfgg6QX5alO8hJGqrgR8iKyFmAJ0x5miXHJvFCQNXsJI1B2MOWxWIV FImr5PvtzPy5jih1pCvY6G1x2QYfqqMsDwFgAHVO/Zl/LOooP46MsTrahx0TdT7+64hM JBTPJ9NoZD9pitrSJYYg6egGd4qzc5A2P3dOuM9ednFIm+kleK2rj93bJvW3YAzzmA1S dut5EFWVUjF3z2xs0jvAVbu2bofMQxLrZid/3CKVNVYLnQ4DuwtqIbBCbMc2tkWDzXVI hrg6U7ekNoW+enRj0Wh7rjvsbRMMDXt3AkPP9vj6iAm1kBZy52hLGCX0g3EZ/MIEZSno 3wFw== 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=43XiVVGq7hH0pR2NpZT+COnrkFVHv9hG501qWIv0FBk=; b=PyXiU1D0bCCTTpUOmvQb6t9rNQHN9+Faz3dgy4/tmufTacfGb9a7MWAluTtZFndg1s Mpp28AA7iAqcozFJ8cJWb5Yc7yO+F6cUcTTlTWMcujwL51K7fiqDw7JrxZwWDnBrlhvW QGLqcfyEyB2GJsRVcE/1eKuDgAawrq+z1v+sF/bfQfkKWnJw1jQfIh+BUvuwrzsO2Rg1 qW7fJ2rD29clHKlR40h+DVEcquqe76OlbXvQmxfr1l5CtOSofL0fEB+OPghxIw/y2AOv XLop48RCpa4o7jinEQHKw2O6VNFvW/QOTFxlT4jSGAQtKRNolP9bsNv/zc1R4GjebDDy oCIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cX+K3/4T"; 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 f189si20077559pfg.123.2018.12.05.04.47.49; Wed, 05 Dec 2018 04:47:49 -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="cX+K3/4T"; 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 S1727900AbeLEMrr (ORCPT <rfc822;igor.opaniuk@linaro.org> + 31 others); Wed, 5 Dec 2018 07:47:47 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35142 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727182AbeLEMrm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Dec 2018 07:47:42 -0500 Received: by mail-lj1-f194.google.com with SMTP id x85-v6so18213272ljb.2 for <linux-kernel@vger.kernel.org>; Wed, 05 Dec 2018 04:47:40 -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=43XiVVGq7hH0pR2NpZT+COnrkFVHv9hG501qWIv0FBk=; b=cX+K3/4THGL5LL0BH8gNtw1VVzI0md6/Rf7zvQ0RAs9iIWIUsKKMFJwGGO84b/jS1i wPTr5cq2UpZWvpN3BYacjvb1/ed/Ds4rVGQcwb0ws7o90U2Rin+AKHtspv9FcvV81vpu JxJhOW5TNBVZe2kpzhaQ9g/ZZkS8EgE2KHXVs= 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=43XiVVGq7hH0pR2NpZT+COnrkFVHv9hG501qWIv0FBk=; b=d+oyEgKC7idklR17mW2RXAPbZyix0NqAOV9NFPxi1+ojDQc3zOxvrcVnxlZ8c0UHfg NxOWvyXdoDQcbkltYwWFHw45WkKG5p9H2MFsBhqqaHFq3eIMxmKV57Mi6CIYhz5Ogufp PCPn49M9gQNR8LqG34wvdYbfIzZxxMW08ZneCqRVetR521gXpUHfElYXhwk60Rvl+9MO UoE9Uz4GbI3bo+oeaA6F0bsXOQw2IuSGrxw63NaAAnFEKqJim0n4AKDHm/22YmQBoezm yavNGWhrqo9IBejJRT7TsSu5WsEqw20R0Jlju7wCKwvkNmclQ5slNi7dXy0zsdY59b+w GF1g== X-Gm-Message-State: AA+aEWZCFS/NPUa7J4kS80JWGXVakYbAXuTAB0kHpD+p35pcm/EDkLna 2m4RdQmnmvwYsiiHOIrCEVJXkw== X-Received: by 2002:a2e:5c86:: with SMTP id q128-v6mr4269476ljb.119.1544014059957; Wed, 05 Dec 2018 04:47:39 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 04:47:38 -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 v3] regulator: max8952: Let core handle GPIO descriptor Date: Wed, 5 Dec 2018 13:47:11 +0100 Message-Id: <20181205124721.26624-6-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/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 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