From patchwork Thu May 15 17:07:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 30274 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7277C20AE8 for ; Thu, 15 May 2014 17:07:45 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id mc6sf770006lab.6 for ; Thu, 15 May 2014 10:07:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=CmHgjAfGc/ia8p/DYSI1dwL5tLpihecGrpl6/qLfvS8=; b=i/7ejKfvU9T8xqQQ9NoMTjKAT5aPNbhcthCniCikoHbLIMT+wmHeB8az7foZwsUFDx yAmqIRsR3kmJY5Ovu0lebUXJgcVI1HNflRAzbTqTTMAdoKPKQBGuiig1mXPNkZmYXiK+ z53RY67QsNOVKN3xaEHkuTU04ZoyMSyHQYr7OIZizfC0KZvQrZezYJ8zYtN5py1NxBNw MfKOXUp98WL8/Zv+Fw46pzIDRpXi803qgQrM661x8PEz3uqkKPA2h/nhb22cNxQKcrQ6 cr8xF/tQgG5ZFZmf+CaZq40T9R5B2Uq9xVt3CI4YdJoqLCBfFPcknYeB8YrKhN+7Vn0J mUow== X-Gm-Message-State: ALoCoQnXCJk9ByzEJdwVID0ULVhYGxAwYfOOBvyKxfZr1pFLra+3Go4KQWzERM1qPYAKx9zORDlW X-Received: by 10.152.21.133 with SMTP id v5mr16112lae.9.1400173663865; Thu, 15 May 2014 10:07:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.201 with SMTP id z67ls164265qgd.5.gmail; Thu, 15 May 2014 10:07:43 -0700 (PDT) X-Received: by 10.52.89.140 with SMTP id bo12mr7980668vdb.31.1400173663709; Thu, 15 May 2014 10:07:43 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id an4si1041601vdd.80.2014.05.15.10.07.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 May 2014 10:07:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id jx11so1717639veb.0 for ; Thu, 15 May 2014 10:07:43 -0700 (PDT) X-Received: by 10.52.3.168 with SMTP id d8mr856906vdd.79.1400173663631; Thu, 15 May 2014 10:07:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp339034vcb; Thu, 15 May 2014 10:07:43 -0700 (PDT) X-Received: by 10.68.227.4 with SMTP id rw4mr14040215pbc.3.1400173662757; Thu, 15 May 2014 10:07:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td3si5971895pab.128.2014.05.15.10.07.42; Thu, 15 May 2014 10:07:42 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754031AbaEORHl (ORCPT + 8 others); Thu, 15 May 2014 13:07:41 -0400 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:48632 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753732AbaEORHl (ORCPT ); Thu, 15 May 2014 13:07:41 -0400 Received: from hornet.Cambridge.Arm.com (hornet.cambridge.arm.com [10.2.201.45]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 0118013FA3E; Thu, 15 May 2014 12:07:33 -0500 (CDT) From: Pawel Moll To: Russell King , Rob Herring , Grant Likely Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Pawel Moll Subject: [PATCH] amba: Put the device's of_node on its release Date: Thu, 15 May 2014 18:07:32 +0100 Message-Id: <1400173652-30583-1-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.9.1 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pawel.moll@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , An amba device created from Device Tree, when released, does not decrease of_node's reference counter. Fixed by adding a call to of_device_node_put() on the release path, in a similar way to what platform_device_release() is doing. Signed-off-by: Pawel Moll Acked-by: Rob Herring --- drivers/amba/bus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 3cf61a1..0f489fb 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -268,6 +269,7 @@ static void amba_device_release(struct device *dev) { struct amba_device *d = to_amba_device(dev); + of_device_node_put(dev); if (d->res.parent) release_resource(&d->res); kfree(d);