From patchwork Thu Jun 7 18:12:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10453371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5584360234 for ; Thu, 7 Jun 2018 18:16:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 472A029A9E for ; Thu, 7 Jun 2018 18:16:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BA5929BDF; Thu, 7 Jun 2018 18:16:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7E1729A9E for ; Thu, 7 Jun 2018 18:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935173AbeFGSPw (ORCPT ); Thu, 7 Jun 2018 14:15:52 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35906 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936058AbeFGSND (ORCPT ); Thu, 7 Jun 2018 14:13:03 -0400 Received: by mail-pf0-f196.google.com with SMTP id a12-v6so5306775pfi.3 for ; Thu, 07 Jun 2018 11:13:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=anGDpg5EHhH3QthmKRd1WTRFpVpJdc53yNgix7wJQi0=; b=mlIhYhpOAxj9gcmDJ+bLEqfCum1aCBUBOVCbwuvqHTEKrOyCKAuJGKTO+nnLBONq0U 8BUC7jsbCD4CU/YGc0//uZgflDmyzD2vgD/5LbJKYzpRQv/lmz3QG3Q5vPfA0vi+RkZz 5+rIuHeucleIK3idbMqEEQk5A42ayjrcXsv3Yxkx+IG7SEa5flJYikFOd3bR0mSptycp MmreEe+f3TEMJrN9rTJT090YiamklRgruFbRdGN6iPsrOjamjUvOtMnvLsR6/l9KcdvJ VvRN9gn99OBYojZQBiSI+tn7CTFwTlM3xFbjPCkSZsMtcIrrsjRbSwZtngSqI9zlHBRv omVg== X-Gm-Message-State: APt69E2bBHa3t+re70MwDIqPFJdR4+qZKOvvaJs01Ztp0iHWRPhnWPHy VU3TRvvfZ1nrfDVxIHLaU1TKAg== X-Google-Smtp-Source: ADUXVKLrCvDBQjHPOB6FrxTcr0TgOj2+Tjb3T1SIOUXRpbPrj7HfoB6T3OyPViCo4NIF5PYEfJxDMQ== X-Received: by 2002:aa7:8311:: with SMTP id t17-v6mr2760690pfm.45.1528395182584; Thu, 07 Jun 2018 11:13:02 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id z3-v6sm5029002pfn.36.2018.06.07.11.13.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 11:13:01 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Enric Balletbo i Serra , Matthias Kaehlcke Subject: [PATCH v2 07/11] PM / devfreq: export devfreq_class Date: Thu, 7 Jun 2018 11:12:10 -0700 Message-Id: <20180607181214.30338-8-mka@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.242.g61856ae69a-goog In-Reply-To: <20180607181214.30338-1-mka@chromium.org> References: <20180607181214.30338-1-mka@chromium.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Exporting the device class allows other parts of the kernel to enumerate the devfreq devices and receive notification when a devfreq device is added or removed. Signed-off-by: Matthias Kaehlcke --- Changes in v2: - patch added to series drivers/devfreq/devfreq.c | 3 ++- include/linux/devfreq.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 4cbaa7ad1972..38b90b64fc6e 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -31,7 +31,8 @@ #define MAX(a,b) ((a > b) ? a : b) #define MIN(a,b) ((a < b) ? a : b) -static struct class *devfreq_class; +struct class *devfreq_class; +EXPORT_SYMBOL_GPL(devfreq_class); /* * devfreq core provides delayed work based load monitoring helper diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 781edefb0087..99d1e02531dc 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -206,6 +206,8 @@ struct devfreq_freqs { }; #if defined(CONFIG_PM_DEVFREQ) +extern struct class *devfreq_class; + extern struct devfreq *devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile, const char *governor_name,