From patchwork Thu Feb 11 10:26:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 61711 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp105147lbl; Thu, 11 Feb 2016 02:26:42 -0800 (PST) X-Received: by 10.98.76.80 with SMTP id z77mr65578771pfa.121.1455186402263; Thu, 11 Feb 2016 02:26:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22si7240467pfq.57.2016.02.11.02.26.42; Thu, 11 Feb 2016 02:26:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751366AbcBKK0h (ORCPT + 4 others); Thu, 11 Feb 2016 05:26:37 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36383 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbcBKK0f (ORCPT ); Thu, 11 Feb 2016 05:26:35 -0500 Received: by mail-wm0-f51.google.com with SMTP id p63so66003166wmp.1 for ; Thu, 11 Feb 2016 02:26:34 -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; bh=Sovt9b4Vk9f83idpSDPwn37qN+pcD+SF/HtNhi/emYo=; b=G33973t/nSZ6Lt3spE5bAcvuCpDsn1EvoEWioYmtsH/a3Ui0FnsFkb0PT+NyGDxM8E KUSv6swghjsK1dwY67gLpwnZdVkxGl3xFa4FDw/OYDOcgeOE8nD26U8aIjHNAAY5Ol8F VbEBowWtGGYh7NRnC5YAaouvN5kB283CfayTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sovt9b4Vk9f83idpSDPwn37qN+pcD+SF/HtNhi/emYo=; b=D3QGTMkCmF+a9AliSy7CheBgw+chdFTGyVGP9hw/7UlS4bWIKzB0t/SgE3NdKBGWSu aP4i+muFOhhjilkrbNoVrPV0aSOvbtdH/BM6VPJRKUrUyQWf9QLS2rTGK6W4GTrCABv0 tG+rPjBjhtLlnJKlPuNaBCmi4fxc/X+pvJk/W+gkEiY3vYFXCaicAT3wGbWoV9j26XWS Xpk9N+vsx6Or/dh/NOOYE7t3H6yvJcuuxw2nCgZwP8SqJKBZFJW03St9MMNRoODsp/Gn /vDHQfyO26uhqQN/tj2LVuPeIRW5k/nzA14Sqe3qrB/dmwbTZk1kLilVXxbg2yaEHvPk P+dg== X-Gm-Message-State: AG10YOTyFfgwUPpw2s+oNOWZcBniOxtFpS7Mc4SUB2kNTP9T1OqVcxzbnDC5XQboo7ASPWwv X-Received: by 10.28.32.147 with SMTP id g141mr16505965wmg.19.1455186394219; Thu, 11 Feb 2016 02:26:34 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id jo6sm6856241wjb.48.2016.02.11.02.26.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 02:26:33 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot , Johan Hovold , Michael Welling , Markus Pargmann Cc: Bamvor Jian Zhang , Grant Likely , Linus Walleij Subject: [PATCH 1/6] gpio: remember to finally free gpio_device Date: Thu, 11 Feb 2016 11:26:18 +0100 Message-Id: <1455186383-28004-2-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1455186383-28004-1-git-send-email-linus.walleij@linaro.org> References: <1455186383-28004-1-git-send-email-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When the device core reference count for the device goes to 0 and it calls .release() we free resources and so can also finally free up the GPIO state container, struct gpio_device. Signed-off-by: Linus Walleij --- drivers/gpio/gpiolib.c | 1 + 1 file changed, 1 insertion(+) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 70e0fff0a8a7..36f8be3f910b 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -405,6 +405,7 @@ static void gpiodevice_release(struct device *dev) cdev_del(&gdev->chrdev); list_del(&gdev->list); ida_simple_remove(&gpio_ida, gdev->id); + kfree(gdev); } /**