From patchwork Mon May 25 14:53:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6474951 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4EE61C0020 for ; Mon, 25 May 2015 14:59:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56DC12012E for ; Mon, 25 May 2015 14:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38C53201F2 for ; Mon, 25 May 2015 14:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751777AbbEYO6q (ORCPT ); Mon, 25 May 2015 10:58:46 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:38583 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702AbbEYO6o (ORCPT ); Mon, 25 May 2015 10:58:44 -0400 Received: by wichy4 with SMTP id hy4so51374282wic.1; Mon, 25 May 2015 07:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=i9Ij4OHo5WClCQMdViNEVQqhk1O1nOe0G1j5cCaxpUA=; b=CI2FSbAQUqWiH+Xgy6lAmZvuN1bA2c4JChLwAkuMX350Fy4yA6/ASmsnsuiQBnEYjL 5sFsD/LwBVghhK/lozFTaJoDuH8KfbQmH55/NGUgABQARliWiE+Ekfg6j8oBiduBEOxE dcsisBkQ4SReq3m4pFcYIfbfMz293dbLkg8fiwjhjcUq5HNS2rtgV4iZxaD6kxzpRQL0 lWtKvLkzKI9/ZzK3y8ZWCqpFgaBn/TbqnWXzyp0R0QPTbRze6wp0bNcKMukm2sb32Gjp XzEf6hiID/NUmRhR3M9Bhlbh+ddbkPTrxVB//ZTKNilLKMghV83TD+feKixlY1F5xxjl iB3A== X-Received: by 10.180.20.12 with SMTP id j12mr31582465wie.4.1432565923491; Mon, 25 May 2015 07:58:43 -0700 (PDT) Received: from cizrna.lan ([109.72.12.80]) by mx.google.com with ESMTPSA id ez19sm12258917wid.19.2015.05.25.07.58.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 07:58:42 -0700 (PDT) From: Tomeu Vizoso To: linux-arm-kernel@lists.infradead.org Cc: =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Thierry Reding , Dmitry Torokhov , Alexander Holler , Grant Likely , Rob Herring , Mark Rutland , Tomeu Vizoso , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/21] power-supply: Probe power supplies on demand Date: Mon, 25 May 2015 16:53:25 +0200 Message-Id: <1432565608-26036-22-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432565608-26036-1-git-send-email-tomeu.vizoso@collabora.com> References: <1432565608-26036-1-git-send-email-tomeu.vizoso@collabora.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When looking up a power supply through its DT node, ensure that the corresponding device has been registered. Signed-off-by: Tomeu Vizoso --- drivers/power/power_supply_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 2ed4a4a..3dbfce8 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include "power_supply.h" @@ -180,6 +181,8 @@ static int power_supply_find_supply_from_node(struct device_node *supply_node) { int error; + of_platform_device_ensure(supply_node); + /* * class_for_each_device() either returns its own errors or values * returned by __power_supply_find_supply_from_node().