From patchwork Thu Dec 6 12:43:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 153020 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp10479556ljp; Thu, 6 Dec 2018 04:44:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/WeoPhGA5CoQJiKI+22wlTnwldZlsC6RVdWM8ckZMHH/DN6Wj99vlSAJUHd+KLB6zEZBN2T X-Received: by 2002:a17:902:5588:: with SMTP id g8mr28202456pli.22.1544100277419; Thu, 06 Dec 2018 04:44:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544100277; cv=none; d=google.com; s=arc-20160816; b=zbfFFLBl0eZ4WY2gKg0Ye5QiAzSfVDRobeMUUeWpBf5ZpoyRbyEb8eThYuQeS1vV92 dcYp09Dxhfm3uJ/F/A9go0OxvO1SR51x36eQvcQZhhUc4s7/wuQBFXvyX6iYrWQV3cyd V6fV82FPW9L66aVVeuLN2lykmBqaPpgR5WnmoMmogqEo6uFejPZJPaek7C5UxfqK4A6I cZQTfWI8u/FydU8WPhF8b1j1yI5ItsOQBR+/Ouw1MLHo3gF/cQDx/rxl6vo8dS/m1snU y0hmT0C+5VyEMer7OOup+lr4D+jK0F5GJfsLRkLbsulkA+8us/vmz1RoYrimrs1owMcJ Jcqw== 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=IltXzK2ZK9ZHKfiax7WiboCIbWrRkEm6SH9GClgJw54=; b=cJhIxKd/1Xv9GMF8551EUYCNrG5yoiRDUUFGK0FkCan1zUYfEAO7kkUavjcbG+9sk0 MhJmuOOoLEWEL5AEnayeZp2IWIEruP0b/kTrtUP95AuFUOfCtDcrCi5LufSoJlkEip/v 5vxkNEGGwYDbt7+Jm7XPLjcH/cOPAruJQNIgOExOi7ah8HJAHAxJuRMVygN6bVdac+cb wuUiyw9WKbTbu/cdtWyxBBp736vruPgumetQZP58p4fMu2S/WDvhSvBpjH25HozgWrQj L4yXcX/Kx6BByNdpWyNpZNPxl3GquCrTFKRRn6hRNzRheosLYlvKfrM4A/KXQ3xx8dzm L1FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UwaP5cZ6; 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 f15si213227plr.144.2018.12.06.04.44.36; Thu, 06 Dec 2018 04:44:37 -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=UwaP5cZ6; 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 S1729799AbeLFMof (ORCPT + 31 others); Thu, 6 Dec 2018 07:44:35 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43416 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729369AbeLFMob (ORCPT ); Thu, 6 Dec 2018 07:44:31 -0500 Received: by mail-lj1-f194.google.com with SMTP id 83-v6so258543ljf.10 for ; Thu, 06 Dec 2018 04:44:30 -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=IltXzK2ZK9ZHKfiax7WiboCIbWrRkEm6SH9GClgJw54=; b=UwaP5cZ669Dbom7ZVrBTTqZdxfNr5vdfG0h8GBbULJ0pwa9g2JVOAOFClMYPId9u3N xfD0mt3KE+HQn11PRhKXdbO+54gkHXSFuWlAAWe/jfSTIx1pL6I7hi3yA3fJw9HN55kJ 1nqFC4yeiZ2xlL3n4v6ZVsmWwb08WEOIIw6ro= 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=IltXzK2ZK9ZHKfiax7WiboCIbWrRkEm6SH9GClgJw54=; b=DRGFqDFOwcrltAhYXjoTcZa6xsUaeAprnDOIWBGncy9NnAdrpu4X1TOt3cPJPIm38E zZxDSF3X6jW11l7geoIvpNg98lPLlSQFnSs3lPUZeQLOkNyvTyKVVIc0qDB53hYa1B5Y v2LjugasHxmpGxs+C0Y0Vbsyy6J8J2CKQWhF+r5Xi2CNRx40ZDAKr1sj7xp1vKxLNJou vKWS/j+vH6BZXTWMLl9Ty0Mr65+sIPOwIeA4cDl2h+GiYl+C8OiGpUsftajbukWiZZmv jnbQlUeE7v38QDzjWnoaI1tRTuwM75BznOjOA+8UqK8JPlq77vVpiLxvslMVOTqcD9SX ax4A== X-Gm-Message-State: AA+aEWZQq1vGZZoPt0F3g7wps/VoOFvb0gcpyRP9b59dJvQy+3VFlguQ oTJ8/Yv8KOZh0THmBYP2t6rchA== X-Received: by 2002:a2e:4503:: with SMTP id s3-v6mr18556920lja.44.1544100269257; Thu, 06 Dec 2018 04:44:29 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 04:44:28 -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 v4] regulator: tps65090: Hand over GPIO to regulator core Date: Thu, 6 Dec 2018 13:43:50 +0100 Message-Id: <20181206124351.10155-15-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 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 v3->v4: - Resending. 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",