From patchwork Thu Jun 21 01:52:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10478975 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 70EFF6023A for ; Thu, 21 Jun 2018 01:54:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62F4D28A56 for ; Thu, 21 Jun 2018 01:54:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5697F28A5E; Thu, 21 Jun 2018 01:54:29 +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 0F2B628A56 for ; Thu, 21 Jun 2018 01:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754585AbeFUBxK (ORCPT ); Wed, 20 Jun 2018 21:53:10 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35061 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754504AbeFUBxE (ORCPT ); Wed, 20 Jun 2018 21:53:04 -0400 Received: by mail-pg0-f68.google.com with SMTP id i7-v6so646877pgp.2 for ; Wed, 20 Jun 2018 18:53:04 -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=6Nsp0g8YXr2r0a/RUnmIzUqht+fwpZClvdZQU3BCvCY=; b=dVSOCWVTkvY4jDwnG8cVdwrbe4hrLVqd1eOnwEsajaWU3Og1GHZTph/2wSvfF6E4qX cPw79KYobTO3fYx7Bdt2sz8oVTUbcHnCEpcUJMidSsdWS2QLsZmc2FuAq5CHLoqC5Yey rteurjcxsWIifbIniO4kLkGo7BGLuBGJayIRAS/hfb8r8M0yMvOnNLR1SO88FmJD0EuY A8z+PTqzf6u6NDPkDZUmNVUgSyyGQk7sSKblPYHGT4zFksn9ylnQjCOBnJveG/iY22X3 AGj8SqnGx+vmtBKv5zDaErgYzcFevbj6lhSHAJo1Ro1z2GzWpAmqBsXdyHSkfU0pbIBQ QJNw== X-Gm-Message-State: APt69E3+BnhLAJV1+KLfUeDf3OWiPGj9LhoC3O4BcFubkPlMNEvrtJif cypa1N5kcRaK5hEw8asOSUMV/Q== X-Google-Smtp-Source: ADUXVKLUlDpx9rB6bF8Ra/Sp6wLJqRq8lLMW6cIjVHsi/Ysat69kLRcOrU8XN+EmLivnzCcemihvRA== X-Received: by 2002:a62:ca99:: with SMTP id y25-v6mr25075350pfk.187.1529545983551; Wed, 20 Jun 2018 18:53:03 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id p12-v6sm6585877pfi.175.2018.06.20.18.53.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 18:53:02 -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 , "Rafael J . Wysocki" , Viresh Kumar , Lee Jones , Benson Leung , Olof Johansson , Matthias Kaehlcke Subject: [PATCH v4 07/12] PM / devfreq: export devfreq_class Date: Wed, 20 Jun 2018 18:52:32 -0700 Message-Id: <20180621015237.100100-8-mka@chromium.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog In-Reply-To: <20180621015237.100100-1-mka@chromium.org> References: <20180621015237.100100-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 Reviewed-by: Brian Norris --- Changes in v4: - added 'Reviewed-by: Brian Norris ' tag Changes in v3: - none 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 c4f84a769cb5..964e064a951f 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,