From patchwork Fri Aug 17 01:45:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 1336031 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 30A9BDFB34 for ; Fri, 17 Aug 2012 01:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932723Ab2HQBq0 (ORCPT ); Thu, 16 Aug 2012 21:46:26 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:61239 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932345Ab2HQBqZ (ORCPT ); Thu, 16 Aug 2012 21:46:25 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr13so2486954pbb.19 for ; Thu, 16 Aug 2012 18:46:25 -0700 (PDT) Received: by 10.68.238.138 with SMTP id vk10mr7652340pbc.75.1345167984931; Thu, 16 Aug 2012 18:46:24 -0700 (PDT) Received: from localhost ([183.37.194.232]) by mx.google.com with ESMTPS id gh9sm3792824pbc.20.2012.08.16.18.46.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Aug 2012 18:46:24 -0700 (PDT) From: Ming Lei To: Linus Torvalds , Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , Borislav Petkov , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ming Lei Subject: [PATCH 3/3] firmware loader: fix compile failure if FW_LOADER is m Date: Fri, 17 Aug 2012 09:45:49 +0800 Message-Id: <1345167949-7419-4-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345167949-7419-1-git-send-email-ming.lei@canonical.com> References: <1345167949-7419-1-git-send-email-ming.lei@canonical.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org device_cache_fw_images need to iterate devices in system, so this patch applies the introduced dpm_for_each_dev to avoid compile failure if CONFIG_FW_LOADER is m. Reported-by: Fengguang Wu Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 4c8d8ef..ed0510a 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -27,7 +27,6 @@ #include #include "base.h" -#include "power/power.h" MODULE_AUTHOR("Manuel Estrada Sainz"); MODULE_DESCRIPTION("Multi purpose firmware loading support"); @@ -1093,7 +1092,7 @@ static int devm_name_match(struct device *dev, void *res, return (fwn->magic == (unsigned long)match_data); } -static void dev_cache_fw_image(struct device *dev) +static void dev_cache_fw_image(struct device *dev, void *data) { LIST_HEAD(todo); struct fw_cache_entry *fce; @@ -1148,7 +1147,6 @@ static void __device_uncache_fw_images(void) static void device_cache_fw_images(void) { struct firmware_cache *fwc = &fw_cache; - struct device *dev; int old_timeout; DEFINE_WAIT(wait); @@ -1165,10 +1163,7 @@ static void device_cache_fw_images(void) old_timeout = loading_timeout; loading_timeout = 10; - device_pm_lock(); - list_for_each_entry(dev, &dpm_list, power.entry) - dev_cache_fw_image(dev); - device_pm_unlock(); + dpm_for_each_dev(NULL, dev_cache_fw_image); /* wait for completion of caching firmware for all devices */ spin_lock(&fwc->name_lock);