From patchwork Wed Dec 5 12:47:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 152898 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9256028ljp; Wed, 5 Dec 2018 04:48:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/WVt3aU0HYfvfmh5K+bRPS/XfUncqXLljYToOIqRtWeZ/8n0zR60WpbD7HVfJtipGDJhsvD X-Received: by 2002:a63:77ce:: with SMTP id s197mr20243567pgc.89.1544014086053; Wed, 05 Dec 2018 04:48:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544014086; cv=none; d=google.com; s=arc-20160816; b=sLXKd+Fqy1NBcvoyanChhinbVCgsekbJ212zPc8sCqfdQ2eX/tPBno6IH5vovpwEj7 EVGDCdrK5PpnF8cna/R3fqLNzWTq9xvJXBdur4BCuo56uRSAi+LXH+FrU3Ky96BO5kwL RyW0UFW0GnMNRI5sZvQ0pjfR1FrjQhZz0DpeHROYAdkMY2toODqV67+AIxMQZfECefkL p9VbWfUUBK8kYOU5f9a/EfErqOn5Ywq/d0+WNNX0AnUBsWNKHesR0TRntAtOCF76JdPW XkBhYvZI9mDgk/WRyQhDr5HkPVCf8U9kD6TqJyiQ2UECbB/BqAGiZ10c3FYMpF/Pq1gs FMgQ== 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=0D3WorUOEulyLATldQc2enEjdRGG/LFQCVQP8Gk/E1A=; b=D3j7WTl2qS09Z5gdOg/sVVnOcH6BIxxxs6gCFdn+eYq5M3wsiup6WTaUB3VuGSz6j4 ZdHsAAmru1M4DZOkzFlE4+sA1RGgebup+nmfdJDnhiRbEn9c15+9rAKCQN+OhOiPbx/x UYKqrHIove0YByAhflZVxu6kCEOC7Dy8MVaQ1tDe4nOqfghSFj/wiL4IY2nrmOFLpzkJ joZEZVBg/wW0/esDKF8EWWfh6Sbz5YLqkpkWkOShCJ1XDHKztH6hDoHq6XB7x4YVphg/ XJ5uct22bBXKFac9vYw7PPNYCnSdrU7dhM8JNRp69l1REGIk6o2/Z2M2Ek/G8I9UX2fX Rl7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AsZ1o/yt"; 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: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7si20831947pfu.270.2018.12.05.04.48.05; Wed, 05 Dec 2018 04:48:06 -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="AsZ1o/yt"; 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 S1727997AbeLEMsE (ORCPT + 31 others); Wed, 5 Dec 2018 07:48:04 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35164 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727972AbeLEMsB (ORCPT ); Wed, 5 Dec 2018 07:48:01 -0500 Received: by mail-lj1-f193.google.com with SMTP id x85-v6so18214209ljb.2 for ; Wed, 05 Dec 2018 04:47:59 -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=0D3WorUOEulyLATldQc2enEjdRGG/LFQCVQP8Gk/E1A=; b=AsZ1o/yt0g+Jl+5sVVA+5jLbXIhFIOHs+/E0m5QBdzSqKk3H2HQVQBnPaQ7m1kDg0m E4lyBOdtrIWEZZhS042uW6mxIPbj59PtHMPHCG4hJGBzVmVqzOLoeojWXRbdjuTWHQug YkAnbaXJL9QUgOwNJ66pXJ3/9RrYCTaWIUyyk= 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=0D3WorUOEulyLATldQc2enEjdRGG/LFQCVQP8Gk/E1A=; b=bYWvtLo5lmfJZyyBK2AMJFZRgWhRQLfd5ch5Pv6+KxtVH8h7MSlRAO/Ri0UW0RZhcr rtqd613xeoOxuZMuhkzZG9FtJJiebnf3jOM6Q5spLuOYSBiQAkhzGvcZI7HY1YI20XoO FojljBmHrU/gHeVHSAEie0YKGmMmhjCjyB2d0vqSthsvlLdq9Yu1xfHWRd6ojXmW+NrI AlQBjsSpzt/3RHq9tmqcCgGfPujr3JexY7gtGdM8Jrm4eZ75jrMfUaio8M9mE+ajskTx ap+ckOa61T3EZdSrxf0BIYRbgEfHjiN9XusQ53MK99zLQMPHcChGGl9LgziJjMCXays2 HW3w== X-Gm-Message-State: AA+aEWb5DQdM6m2drWaPCknkMiXBq5T1qClHQx4LDKiba/UJXD4djm7I 2RH2DwP7vhTBgSyWGg8Unyy07Q== X-Received: by 2002:a2e:5747:: with SMTP id r7-v6mr15201268ljd.141.1544014078967; Wed, 05 Dec 2018 04:47:58 -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.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 04:47:57 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Charles Keepax , Bartosz Golaszewski , Marek Szyprowski , Linus Walleij Subject: [PATCH 14/15 v3] regulator: tps65090: Hand over GPIO to regulator core Date: Wed, 5 Dec 2018 13:47:20 +0100 Message-Id: <20181205124721.26624-15-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The GPIO descriptors used by the TPS65090 driver are retrieved during probe() and it is really helpful to have those under devres management because of all the errorpaths in the intialization. Using the new dev_gpiod_unhinge() call we can remove the devres management of the descriptor right before handing it over to the regulators core. Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Resending. ChangeLog v1->v2: - New patch handling this drivers GPIO descriptors properly. --- drivers/regulator/tps65090-regulator.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.19.2 diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c index db714d5edafc..0614551796a1 100644 --- a/drivers/regulator/tps65090-regulator.c +++ b/drivers/regulator/tps65090-regulator.c @@ -480,6 +480,12 @@ static int tps65090_regulator_probe(struct platform_device *pdev) else config.of_node = NULL; + /* + * Hand the GPIO descriptor management over to the regulator + * core, remove it from devres management. + */ + if (config.ena_gpiod) + devm_gpiod_unhinge(&pdev->dev, config.ena_gpiod); rdev = devm_regulator_register(&pdev->dev, ri->desc, &config); if (IS_ERR(rdev)) { dev_err(&pdev->dev, "failed to register regulator %s\n",