From patchwork Sat Dec 1 15:41: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: 152643 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4934685ljp; Sat, 1 Dec 2018 07:53:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/UXpBOvFtNF1rKwO9BiiANSEnGKpf9JXug9FzB+GBRjwdK2dPYZnxpN1wruQ0CtuAHScPii X-Received: by 2002:a62:e201:: with SMTP id a1mr9473239pfi.75.1543679611546; Sat, 01 Dec 2018 07:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543679611; cv=none; d=google.com; s=arc-20160816; b=zGi/rWGDKjmoM8TJ/VTFe5EjRnmJEy4e6AyDUooD1F7L+rdyS4hapVRJCA35gnms0i +m07dg7u7dZiZUtsIjFFpa+5wnqGwAiPgwuhIkKBa9qHwjE2yz9AYtWbaOCtnx4wx+/p 62qNp5n2vAvhar0oS8Of5MzcD3A6uMvdr0yVAXqlhtYqeM0XUOkDd2QrNGuZRQvITzHv Z73V5bwvsomPY8x5NOEbiuTfVF16GGaiJii1HFe5MvZ9Z5J/tPDPpfdXI3mwyOcf7Ggx SLkI8l8gKDA9xyGEiTH8TtBaJIJSU0z6Dk/ConSmdr2SeX+J3C98guep30tqSRE2J19q B/tg== 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=ruvG321c2erSKd4WYuxWeHCQ5T1dUamVjuDaYGBmTnk=; b=QVL5yiVT5YamGQZDwWMeiKyHD03irEXatF2fY7YvNmCjcFajAZrkw7/kavyVO4JCLA vmp9VDGZ0qD8RQhCmdyCBWvZBj6eq+U3pw42QeukMFYrjB/ZjbvnZJIhmrUzGRkrhyxF 96ZVxmrVbHcPRTbxt9ojkBzXtNE/z1ZEfmFoDlpVfvhDNN4i+lqdeJU9AsTPpUMBsl17 MP8Hf4gvakagX5o6mQHkW7NmUM9qyO0iDia/OxTRo03gbVS5amBMs/q2EEdJeISUs+pz QcFJBhZi9m3XZH4vO1+7Mh+vg4qG10CoeS+PQHmF50OUsLdfO+4/BqN+uQPZhdqYfrEP On+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=St0vJBFM; 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 i5si8204825pgn.243.2018.12.01.07.53.31; Sat, 01 Dec 2018 07:53:31 -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=St0vJBFM; 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 S1727417AbeLBDGR (ORCPT + 32 others); Sat, 1 Dec 2018 22:06:17 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37945 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727379AbeLBDGR (ORCPT ); Sat, 1 Dec 2018 22:06:17 -0500 Received: by mail-lj1-f193.google.com with SMTP id c19-v6so7638158lja.5 for ; Sat, 01 Dec 2018 07:53:27 -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=ruvG321c2erSKd4WYuxWeHCQ5T1dUamVjuDaYGBmTnk=; b=St0vJBFMo1PEOsZeu5nQ1jcY2njdXe6Z9sgqA8e0yP5b9MZIoE8amrZwNPJfR02BZ0 33PhtotojcF3qCbbj8J4oyxDYszcJP2IeY6RjxkIh+NmY/Ko0yThJ2HSpiBL+JwI4Xe5 8XHZWoG5y60Hma2lanMhUPrr3PDd4JBWbPbSg= 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=ruvG321c2erSKd4WYuxWeHCQ5T1dUamVjuDaYGBmTnk=; b=nXRxEGOyj4/cLk0KBzwb46ROYC1RwNAS/PZoUNY0VLPbTJ2s/lBonRZpRhomHOpUch LTZyuY78T/o9lwhpXwQmkaHpjKIaedHyhNE+72JJ4c+Pw1/m2/cRUpTvC9pXAwU9szUn wYIRyh4RZLXLcCwrLN5gxXjHozRIBPpRPnJz3aAO8IsQVoEfL6QQsrOCYvRddiB24OtM io4AlWj1L/bnLXpeij4nnuApbY6W1+57J9nfiU/yvS1WpOJJfCtU5DVptmrP7UnN7BnN ncb8MG9U7t8yKcXue1qC8U69WS/CrxldquJUKQXxXAeJhVrnN9pG9tQzvAjSjcjvBjcB g+yw== X-Gm-Message-State: AA+aEWbBxlaHppPcGlWr452ebPgFvJXc8USrFWAT4yPmUnXSmUrs0inl 1HrPAlD6ogF55CauIePwAqX38A== X-Received: by 2002:a2e:5b1d:: with SMTP id p29-v6mr6224863ljb.176.1543679606971; Sat, 01 Dec 2018 07:53:26 -0800 (PST) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 13-v6sm1365426ljj.49.2018.12.01.07.53.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Dec 2018 07:53:26 -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 12/13 v2] regulator: tps65090: Hand over GPIO to regulator core Date: Sat, 1 Dec 2018 16:41:50 +0100 Message-Id: <20181201154151.14890-13-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181201154151.14890-1-linus.walleij@linaro.org> References: <20181201154151.14890-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 v1->v2: - New patch handling this drivers GPIO descriptors properly. --- drivers/regulator/tps65090-regulator.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.19.1 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",