From patchwork Thu Jun 14 19:47:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10465183 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 C3F14600D0 for ; Thu, 14 Jun 2018 19:48:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B40872883D for ; Thu, 14 Jun 2018 19:48:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A83CB28861; Thu, 14 Jun 2018 19:48:48 +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 5F0612883D for ; Thu, 14 Jun 2018 19:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755454AbeFNTre (ORCPT ); Thu, 14 Jun 2018 15:47:34 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:45795 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755410AbeFNTrc (ORCPT ); Thu, 14 Jun 2018 15:47:32 -0400 Received: by mail-pg0-f68.google.com with SMTP id z1-v6so3364428pgv.12 for ; Thu, 14 Jun 2018 12:47:32 -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=93LuuHsiXv3xJdqc6HhDcgdFIGGpIx8xIdJfw9X8aOQ=; b=Ffp2TdwoDrSh/ewCBB9rs7iAtcVvR20uX2UC5ogkJqOcbI6gCsdlDWZtbGyxIMcStq Z43wBEfzt6Cp8qr8Nm4gYG8Rtqo9ZENGGrIF2BckoI5ThVm36dlNfnp7JxJJWzhWmuFG 2SpGiZUUHV4nbXjcC7Y+BEQ6DaYBqR3vwW/YYXaHl1t5mdNtdWMWTv6CRuuk0LQRYtM1 1sv4JoPyIP5sgsKF0KR2oSzBfs7UICJT4DwamlH+INOid989zJllMWKBJ3KyXx6sPvGw 9UBYInQDtBwu5LzeiX5i/6RaqaeC4Mt4xuqDT+I7yKI8e33eN7sLb5Dh2+gHEjNIyZKQ hmog== X-Gm-Message-State: APt69E1E96La3wYUhqXsV7vrIwBcKEYMdqd2t77BTslLargaj9iWQiQP jEp7TZD+ISiIEOzGtU2ZxAZGdg== X-Google-Smtp-Source: ADUXVKL4xU6ZqA9ZNvY21bkltUKF5zlSce6LYPDPid+TLTB6JtjX4AjRo8V3Nja1nvuc9JudqXjDBg== X-Received: by 2002:a62:5d83:: with SMTP id n3-v6mr10936041pfj.68.1529005651834; Thu, 14 Jun 2018 12:47:31 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id s28-v6sm9955506pfg.89.2018.06.14.12.47.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 12:47:30 -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 , Matthias Kaehlcke Subject: [PATCH v3 07/12] PM / devfreq: export devfreq_class Date: Thu, 14 Jun 2018 12:47:07 -0700 Message-Id: <20180614194712.102134-8-mka@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.242.g61856ae69a-goog In-Reply-To: <20180614194712.102134-1-mka@chromium.org> References: <20180614194712.102134-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 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,