From patchwork Tue Dec 11 09:53:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 153411 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp420595ljp; Tue, 11 Dec 2018 01:53:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/XSamcQQ608bV8ahv1RuLg/ioiNww0fmdaSOYd7L1tfGQswrRvr7qZe2W6tkjCWAisTgR/Y X-Received: by 2002:a63:e84c:: with SMTP id a12mr13860085pgk.241.1544522008444; Tue, 11 Dec 2018 01:53:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544522008; cv=none; d=google.com; s=arc-20160816; b=ZgWlA2MTtMVVwRoFvotBG6DiJ0TqNv3xun6cvGijhbwptwqYmqxzg0zwLXHNG+io2C Pk629kzt2YR3UoMV22Pi63hycCo+ive/Cs5xhZvT7B5GWnr6xqio9An+E4V87VXWW48u YJotfHP48Ph+zqC1Q5y0LxGlIERdeILxiaf3NFANfKa/d7TXSmSxEDKrZXzUgk8QOIjf D3U5g34OVMSO/CVoV0daaIrPDBSANmt5vkbXLOj04opscVGNQLgwzDL1cVX2Y9kZsYyM zFb8ocwHRay7qFo5SD12TxuI28XEfXj5t9K9ktyUSvX1uR5lPRRnL7GDIuBmRBK+XSLD cU9Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=G6ItMC8Daj1okFQsaf/UZWIovBp6EzsjnZ7CGkAZOD8=; b=PrHlNvRpxZ1wtidptKpTymsrkXUk8FDCewZYSNiaMdlVoAV/zPLnlEky4d24QGmZTa ZwYlEwt6s0Qpm0Tuy5Q44UUh86svvt3dKPmnTBEkcl8ZVTFJawvPnquR3Rq24d/3IrIg oODVWMyXGs25/ACyiq2vsiUyOXMx/btzXBCmQmLHpyxniqrQ5Zme6yCiv8E2QUIDvvy7 UDjK0rFBOokgu/tZ0uno7rDSNkXOwFsixAqUSop8CG5JW4rvWZVgjouap6Tqj3hlRGwR N5cm4XVoSQMZDbagZAAZ5uoXP1Dmy0ZPNhtDQeEenQz8XEP5y23LM3BHxw2Kw2Im5b2a I6fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S9VamWUw; 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 c17si11760336pgl.385.2018.12.11.01.53.28; Tue, 11 Dec 2018 01:53:28 -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=S9VamWUw; 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 S1726339AbeLKJx1 (ORCPT + 31 others); Tue, 11 Dec 2018 04:53:27 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:39098 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbeLKJx0 (ORCPT ); Tue, 11 Dec 2018 04:53:26 -0500 Received: by mail-lf1-f67.google.com with SMTP id n18so10284704lfh.6 for ; Tue, 11 Dec 2018 01:53:25 -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:mime-version :content-transfer-encoding; bh=G6ItMC8Daj1okFQsaf/UZWIovBp6EzsjnZ7CGkAZOD8=; b=S9VamWUwSd59nVvevQ/hG3Wg4Mjm+YocI2xbfu/GMRGsRyPcsyjFqVBwLtCo1uuM+y yLc2WF5P1JUdiCMzGZf2k7Cj2ypX0UJgTUcyz/I3nk2mtlfyfqQ5uBCG87C3O3Fk2PHS WoHnn6r/YKqiGuHwXwoq7duEeNvWmQS+IeTvo= 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:mime-version :content-transfer-encoding; bh=G6ItMC8Daj1okFQsaf/UZWIovBp6EzsjnZ7CGkAZOD8=; b=YzHJs4a5IqzoeUiUdS87PWbtaqiJlN644unteU4bU/s4V/vUbWQiOdctAJShqy6/SR irIYenepKgid7Jd8v8GB6aG+GFBMb/sGj8kxfc8Ko5yYlby4sz+qr8wl6TQYv4ZpmV5F oYlymGfjBe6wlmQotJaZeN5/R5FJGigNJIK0cyWb2ZDcuDniPFQH8AO1N7NFYe5MFmAG vTIBAe2qK15/MMHSvj5bwxqQMplF1oT0UY5YPMmkCCzq3SCVbovjq2z//lst9N/+781u Z+2Phx9LuJRsMqm0i5c9l0UZTfNoAd9z1/6LdC0NuC/c51sEVkKakYDea8avqTyJPM9s b07g== X-Gm-Message-State: AA+aEWY96UAunb6805w643yvDUuV3c+h6+D4APQY/apUXe1Rpa6KK6Nq tJm6myMQUL6+NfA8R4KywGV56QJNh6kQpA== X-Received: by 2002:a19:1019:: with SMTP id f25mr8691342lfi.54.1544522004224; Tue, 11 Dec 2018 01:53:24 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u30sm2740505lfc.90.2018.12.11.01.53.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Dec 2018 01:53:22 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Charles Keepax , Bartosz Golaszewski , Linus Walleij Subject: [PATCH 1/2] regulator: wm8994: Rely on core to handle GPIO descriptor Date: Tue, 11 Dec 2018 10:53:18 +0100 Message-Id: <20181211095319.11393-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After making sure that the regulator core always take over handling of the GPIO descriptors, the gpiod_put() on the errorpath of the wm8994 driver becomes redundant. Reported-by: Charles Keepax Signed-off-by: Linus Walleij --- drivers/regulator/wm8994-regulator.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.19.2 Acked-by: Charles Keepax diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 46e6b4ee1491..38928cdcb6e6 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c @@ -172,6 +172,11 @@ static int wm8994_ldo_probe(struct platform_device *pdev) ldo->init_data = *pdata->ldo[id].init_data; } + /* + * At this point the GPIO descriptor is handled over to the + * regulator core and we need not worry about it on the + * error path. + */ ldo->regulator = devm_regulator_register(&pdev->dev, &wm8994_ldo_desc[id], &config); @@ -179,16 +184,12 @@ static int wm8994_ldo_probe(struct platform_device *pdev) ret = PTR_ERR(ldo->regulator); dev_err(wm8994->dev, "Failed to register LDO%d: %d\n", id + 1, ret); - goto err; + return ret; } platform_set_drvdata(pdev, ldo); return 0; - -err: - gpiod_put(gpiod); - return ret; } static struct platform_driver wm8994_ldo_driver = { From patchwork Tue Dec 11 09:53:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 153412 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp420659ljp; Tue, 11 Dec 2018 01:53:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/U9C8Oxx8YiRxacS1+U2YHymAAIemvkFBJk0IHKZRCANqzuWdxKMLj0QxTsFksF6BlnNmah X-Received: by 2002:a62:1212:: with SMTP id a18mr16204137pfj.217.1544522013913; Tue, 11 Dec 2018 01:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544522013; cv=none; d=google.com; s=arc-20160816; b=CCex6WvyzPQc4IKER/jsGeYsCWB2ykOT5NicM1tA7cAHOT068kBkjTGG8K5Bwj44rq ykeI1BYJMwkJHl0t+QbLhtPOZz6RDfQc80RjF23N8/rPCWre8UtKfEuK9rzp+ZC6XS5D smd2Yl+8/YZ4/AOZgV4FO78aqr2faGZSF2O1PJ2349Y86VmLmnigMjCHlxuN6vi8ilgz vDyfbItBRH9R1zo1VeAXv4PIZgtf7CfoYQPD+CVGfVsWxCA8ZMglUuWrPpAqoFrqxwA5 RDSDA5HQmvki67miYzDhBJQyZRhLbJtrpjRvpZw3GUM08FksAA5aNeJsoRg24KlfJJos yOgQ== 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=1kanK1ADQJ84RZMElpetldmLcARBv+ZdrFC6bdBVdaw=; b=d7WtxgBCOF3648osJnObXdeY4CEbwnOKD+iTX9zIFM6cfQEpi2yq+/WrSZExce+MUX hWiwAWl1wkl0mYkNTiNwNZ+W1pXbm7JN4iUtlzQTOGpQjWp+MSsfulCebhQJ0SBSqowI 3kcwIPzYisjz0sFf49hPMwxJaf1iA4CsusYSv9j3Q+m/HrrVZYwYKzQywSZvC2URtr/3 vmyic9sG8QwMAn1Y4pvfMovVjHI0EGrAbwNCrmBQ1T2pMxdy0Hixuucd817g3tW58lr8 TjXqE0erpDSwHMVEc4eiZwRqkQWGNULnNi8tV2U28R9iqJGBF83LkvPO0LK0aSRVz2Tq NbKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cfuZnd1z; 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 u202si11603273pgb.115.2018.12.11.01.53.33; Tue, 11 Dec 2018 01:53:33 -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=cfuZnd1z; 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 S1726362AbeLKJxb (ORCPT + 31 others); Tue, 11 Dec 2018 04:53:31 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:46223 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726330AbeLKJx2 (ORCPT ); Tue, 11 Dec 2018 04:53:28 -0500 Received: by mail-lj1-f194.google.com with SMTP id v15-v6so12327518ljh.13 for ; Tue, 11 Dec 2018 01: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=1kanK1ADQJ84RZMElpetldmLcARBv+ZdrFC6bdBVdaw=; b=cfuZnd1zXhBa64EQ/9iHYJtaxeXlNRbaB+Mr0uhl0pePo780Axff1DLmWXVObPCBI5 BgQKsF9EpB+tY32WbwwXTqNcfJtMG3HapRGCRJ3qpXz5HR78YlpwODSHiHWqnSWw4fH7 +sysjCR/Y4ue9IbvJ9RwhGsQHVZvTA0T47qNs= 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=1kanK1ADQJ84RZMElpetldmLcARBv+ZdrFC6bdBVdaw=; b=TA5a0gESXsb1iSotGya+tXUsNd3R33OsFt3AOYCUfzIWwkuL2kZdI7sBh5tZFFHif8 atSQvDMlBPif/xEfb2DUxmta1QO16hpVd1tWz8Vt2Ao+Es5yTVFBoefljwgaMYfs0HGo P8YyDlSlnXCT1vcpnTqPuOhA14UVKaEpflq7M/kdO3fA37g5Qt/tF/Q6VwzfHs9pyeAy XrXpi5iQIbge+6JyezgXbPjBrYttJDo3e3JvI2yyBe/yleCLtd2IrSfGhB7PZM54t+1g aH4gTZ/0M5swS9ou6mjeiisLiNMKyJ3jnRrtTaEolKKiPyetTwBdxpIgDsHM7AWLBUrz VyxQ== X-Gm-Message-State: AA+aEWahcaoonYA48qwzrrTfbPv4AJZH1I30nw9ekUi1HZa6T3wV1vgm /sv9FY06ugDUYf5Uk+pOdV+0/w== X-Received: by 2002:a2e:302:: with SMTP id 2-v6mr8993900ljd.137.1544522006429; Tue, 11 Dec 2018 01:53:26 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u30sm2740505lfc.90.2018.12.11.01.53.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Dec 2018 01:53:25 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Charles Keepax , Bartosz Golaszewski , Linus Walleij Subject: [PATCH 2/2] regulator: arizona-ldo1: Rely on core to handle GPIO descriptor Date: Tue, 11 Dec 2018 10:53:19 +0100 Message-Id: <20181211095319.11393-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181211095319.11393-1-linus.walleij@linaro.org> References: <20181211095319.11393-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 After making sure that the regulator core always take over handling of the GPIO descriptors, the gpiod_put() on the errorpath of the Arizona LDO1 driver becomes redundant. Reported-by: Charles Keepax Signed-off-by: Linus Walleij --- drivers/regulator/arizona-ldo1.c | 3 --- 1 file changed, 3 deletions(-) -- 2.19.2 Acked-by: Charles Keepax diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c index 9a72eae4926d..b9a93049e41e 100644 --- a/drivers/regulator/arizona-ldo1.c +++ b/drivers/regulator/arizona-ldo1.c @@ -283,9 +283,6 @@ static int arizona_ldo1_common_init(struct platform_device *pdev, of_node_put(config.of_node); if (IS_ERR(ldo1->regulator)) { - if (config.ena_gpiod) - gpiod_put(config.ena_gpiod); - ret = PTR_ERR(ldo1->regulator); dev_err(&pdev->dev, "Failed to register LDO1 supply: %d\n", ret);