From patchwork Tue Jul 3 23:47:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10505627 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 75D8260225 for ; Tue, 3 Jul 2018 23:48:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67F9228979 for ; Tue, 3 Jul 2018 23:48:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BAF12899B; Tue, 3 Jul 2018 23:48:35 +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 1567C28979 for ; Tue, 3 Jul 2018 23:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753623AbeGCXrg (ORCPT ); Tue, 3 Jul 2018 19:47:36 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:39768 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753419AbeGCXrd (ORCPT ); Tue, 3 Jul 2018 19:47:33 -0400 Received: by mail-pf0-f195.google.com with SMTP id s21-v6so1729787pfm.6 for ; Tue, 03 Jul 2018 16:47:33 -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=CcDxclZT+Ks3JwcbvTbM/8mgbIqbve7zsaiHY28IDao=; b=KOZTfTr8sG4ZKoiXlW55Sa3ws0/CejBlyOxyWhCxFJ/PX9gZky7+vv+EBkQepDV5V4 sXsFIg+iqKneg8l6PcoH7mWyKE6zGhKSG4/x1Ed9uZTQy3IXcfxQR6XMm3W1n7xmO0o1 R2H2abCIyoNWLQPokQflrlL/rm7AVLSWg1YqoLyOcMv0BQMHiMlawoBCRUNBqkZeto1p 79XQJtpCA+0LZrrCZtzYVah5oUAGc1ArV96uXU0C+rBO6YhXwHkwgKan1kIp1rkycolB RZqevN9KGfw6b0qFB2y/SA70axzr22iLu0u//fGgcKSGVNWdlqL8aBcQZ58awUHogS4f DaaQ== X-Gm-Message-State: APt69E0xa1SV8G3UJ4IulJW/bLwBZS9g7rT278YumLMISP1k/X4ovNev /dwg5QgTRiIALNx43InWm6ghkQ== X-Google-Smtp-Source: AAOMgpcT10Qo0MXuuXV+BvGygiXv/gRYKzeUivrm1HR+UMXYXlCUhd+l0lsgnejZzjFYUZYjB8CsHw== X-Received: by 2002:a62:f50b:: with SMTP id n11-v6mr21637936pfh.120.1530661652966; Tue, 03 Jul 2018 16:47:32 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id l85-v6sm6608562pfk.79.2018.07.03.16.47.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 16:47:32 -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 v5 07/12] PM / devfreq: export devfreq_class Date: Tue, 3 Jul 2018 16:47:00 -0700 Message-Id: <20180703234705.227473-8-mka@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180703234705.227473-1-mka@chromium.org> References: <20180703234705.227473-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 v5: - none 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,