From patchwork Sat Jun 29 01:22:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 255701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BBAC92C00A1 for ; Sat, 29 Jun 2013 11:27:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753289Ab3F2B1S (ORCPT ); Fri, 28 Jun 2013 21:27:18 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:64322 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752927Ab3F2B1R (ORCPT ); Fri, 28 Jun 2013 21:27:17 -0400 Received: by mail-pd0-f169.google.com with SMTP id y10so1360524pdj.28 for ; Fri, 28 Jun 2013 18:27:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent:x-gm-message-state; bh=W8qtpvK7dCjdmHZcNJOntpeoliuY03wp1vSlXz5GMXU=; b=GxZo7UNPzPix2NMiGpBuUXWkRE6huaWsdOh5ham/LfYLiPkZkrplpaJ1bJtciMQZfB WTRSUZRX8LfrIjNCDcnj5LtutO8615POXSRavdL7al6GOSzT1oHzvbBr8NmeRHs2eJ7H 9rb8R1RVKoY3kAstzPReLm92UvvB521fi83vM/kEPgwxunNr1u82uozDMy53pA+5ZMTY JihCmrRoY5hvwDC0SeOceceXFmpagMp1VzbIrZfp4AUPv1eJTAajXztJwY/B1XDWAsJD FGmnXCnmVWSECd2mhc3hOt2e95Be63zRwAPGmkslP9UIbe9ffEOjli2NY2LX/QlTWlyW C3bA== X-Received: by 10.66.159.195 with SMTP id xe3mr13816146pab.49.1372469237424; Fri, 28 Jun 2013 18:27:17 -0700 (PDT) Received: from localhost (ip-64-134-225-216.public.wayport.net. [64.134.225.216]) by mx.google.com with ESMTPSA id oy10sm11382143pac.9.2013.06.28.18.27.15 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Jun 2013 18:27:16 -0700 (PDT) Date: Fri, 28 Jun 2013 18:22:55 -0700 From: Anton Vorontsov To: Rhyland Klein Cc: Stephen Warren , linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] power_supply: Add of_node_put to fix refcount Message-ID: <20130629012255.GA20924@lizard> References: <1370899602-22123-1-git-send-email-rklein@nvidia.com> <1370899602-22123-2-git-send-email-rklein@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1370899602-22123-2-git-send-email-rklein@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQlhDa2MYHadaUU7dZ/IwSYCV2Yo5XTfc2C0zbCkO2/Jg92dOom8VM/3suc8tKBoNsVJMdh3 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Mon, Jun 10, 2013 at 05:26:39PM -0400, Rhyland Klein wrote: > of_parse_phandle increments the refcount for a dt node before returning > it. Add of_node_put where needed to properly decrement the refcount > when we are done using a given node. > > Signed-off-by: Rhyland Klein > --- With CONFIG_OF=n I got this: CC drivers/power/sbs-battery.o drivers/power/sbs-battery.c: In function ‘sbs_probe’: drivers/power/sbs-battery.c:707:20: error: ‘struct power_supply’ has no member named ‘of_node’ make[1]: *** [drivers/power/sbs-battery.o] Error 1 I fixed this by the patch below and applied your 1-3 series. Thanks! Anton commit b50df95c8f0703c95625181d2eaf53855c5ebee5 Author: Anton Vorontsov Date: Fri Jun 28 18:17:22 2013 -0700 power_supply: Move of_node out of the #ifdef CONFIG_OF Similar to linux/device.h, move of_node struct member out of the #ifdef CONFIG_OF so that the drivers won't have to mess with #ifdefs in .c files. Signed-off-by: Anton Vorontsov --- To unsubscribe from this list: send the line "unsubscribe linux-tegra" 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/include/linux/power_supply.h b/include/linux/power_supply.h index 3828cef..804b906 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -162,6 +162,8 @@ union power_supply_propval { const char *strval; }; +struct device_node; + struct power_supply { const char *name; enum power_supply_type type; @@ -173,9 +175,7 @@ struct power_supply { char **supplied_from; size_t num_supplies; -#ifdef CONFIG_OF struct device_node *of_node; -#endif int (*get_property)(struct power_supply *psy, enum power_supply_property psp,