Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp754181pxk; Thu, 17 Sep 2020 15:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW9ktkj6k7Uq0HdVqXlYGnUZ/jHDQV10GaqM6YEHAeOhvGRJXMAuQQYXHSwgu3CCE0pHGE X-Received: by 2002:a50:cf46:: with SMTP id d6mr35832239edk.339.1600382245209; Thu, 17 Sep 2020 15:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600382245; cv=none; d=google.com; s=arc-20160816; b=ctbPyBmNvADDEjf3XeexxWDsmNha8IbFn9nIRNv4h0V+HFwJN4/IPjt4qJyj83TOXc 7FTwbNYUMj54986pofDLu2IhHmYirOpzcgan7vmvAhevELYnWrAFRxOOkV7TvGhYUqyq yAq7cRQN9wIOXnG+nZv3uKGh0zgKKByOAyfFQVXhPbBb59eiS+pq6+TISdcL3e7S6pi1 txT4+5C66s8UkczzR4CavYvRcoClS7eaVu2uH/G55tUT7dWbIjiCX7uraECkQtxURbNf kZhmWnY3IkPc9nbqzXle96Wc2WgFpI1A8DpawIusqBkXgb/4T3idhYj+GMdbFPf60Gyo NF/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mbH64SYg37PeDZs/7vCAHYIHkcY15dzxUwQm4FFglyA=; b=q7AsJqFMcp77efRYjJvypK4Lp+JTD4bGYUU8XbhUsLcN+mG+aXajfsiV8U8V12/44U 7Xfetnu4qo+AdCaOQDLr2qf5ZUDkFtO4CxKZlXdSVWAF2x+9YHrEJiMPmON2JxAoKO9q jy++iIFyYcpWEmVAVn6ZNEjkOksLH8+M1n501BOz61Zc3EzIVPfZMvD6QRn5AMiFMOKh eIo/nT5e4T0582VoYi3FW5g3vzrhFZys5n3uUaCp4oRPaKQxYOTCMTkOVKs5/T3RjRPt 3YCt8DPAg2Xc+l3XCalWICPzXPCFqIyTGGtS/uELg9nuRJFPCIzGdUdTbGdKi27cqCOL 72eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=Z7KdQ2N8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si915025ejy.154.2020.09.17.15.37.02; Thu, 17 Sep 2020 15:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nic.cz header.s=default header.b=Z7KdQ2N8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbgIQWfR (ORCPT + 99 others); Thu, 17 Sep 2020 18:35:17 -0400 Received: from lists.nic.cz ([217.31.204.67]:35524 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbgIQWeN (ORCPT ); Thu, 17 Sep 2020 18:34:13 -0400 Received: from dellmb.labs.office.nic.cz (unknown [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463]) by mail.nic.cz (Postfix) with ESMTP id 9E7DB14205F; Fri, 18 Sep 2020 00:34:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1600382040; bh=QCP2wLMmyumTwoOiIgbl7vvdMWG8GVtVNf+P0fK63Q0=; h=From:To:Date; b=Z7KdQ2N8E/YUa9YZlM1g5neLzYJRc0vCN5v5+RkyxEG9r3z0cWtem7HTwavFiW6ns o/ypoUMK8TJKzGoBvagozhPans/1tL4AXlYOp9bGRWAT8PMVhB0fKMO1v3Y/P8Vop1 YzcYskLbwoP9Qg0l8kGjeSgG3/l5s2CJpY9Q1i8A= From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: linux-leds@vger.kernel.org Cc: Pavel Machek , Dan Murphy , =?UTF-8?q?Ond=C5=99ej=20Jirman?= , linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Simon Guinot , Simon Guinot , Vincent Donnefort , Thomas Petazzoni , Linus Walleij Subject: [PATCH leds v2 40/50] leds: ns2: use devres API for getting GPIO descriptors Date: Fri, 18 Sep 2020 00:33:28 +0200 Message-Id: <20200917223338.14164-41-marek.behun@nic.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200917223338.14164-1-marek.behun@nic.cz> References: <20200917223338.14164-1-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Spam-Status: No, score=0.00 X-Spamd-Bar: / X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This drivers leaks GPIO descriptors on driver removal. Use devres API function devm_gpiod_get_from_of_node instead of gpiod_get_from_of_node to avoid this. Signed-off-by: Marek BehĂșn Cc: Simon Guinot Cc: Simon Guinot Cc: Vincent Donnefort Cc: Thomas Petazzoni Cc: Linus Walleij --- drivers/leds/leds-ns2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 46d4f7e963c04..fa06ab40ee143 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c @@ -240,13 +240,13 @@ static int ns2_leds_parse_one(struct device *dev, struct device_node *np, if (ret) led->name = np->name; - led->cmd = gpiod_get_from_of_node(np, "cmd-gpio", 0, GPIOD_ASIS, - led->name); + led->cmd = devm_gpiod_get_from_of_node(dev, np, "cmd-gpio", 0, + GPIOD_ASIS, led->name); if (IS_ERR(led->cmd)) return PTR_ERR(led->cmd); - led->slow = gpiod_get_from_of_node(np, "slow-gpio", 0, GPIOD_ASIS, - led->name); + led->slow = devm_gpiod_get_from_of_node(dev, np, "slow-gpio", 0, + GPIOD_ASIS, led->name); if (IS_ERR(led->slow)) return PTR_ERR(led->slow); -- 2.26.2