Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp187573imm; Tue, 3 Jul 2018 16:49:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfW5oznyBitgMLjlax4DxCiqZBLi3S5ko3zENNHc6Ov5RbUjd8uyTELgS5ojwXioP8MKNX1 X-Received: by 2002:a63:501c:: with SMTP id e28-v6mr2579213pgb.114.1530661785369; Tue, 03 Jul 2018 16:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530661785; cv=none; d=google.com; s=arc-20160816; b=yrYWRmKhaFt5SoeSgRP3780FrdlnQDu5++NfCdjyTt6E4JuPN09leG+1WkbSCmvtg6 3ZMqj6+gQQndd1SeLKF3bwl5K31bhWj80P2VdbN4HX+7wfwLOtOQP/PXksQQ0eI5ddai /BgVyQCFPq+SSF2tBIJy+SQDNKXW81bfEXP51Sws7CJBaEnwPPjpPT1jO3FXaV0UN75a VSTVNi/xE5+1+ptF9BxDquLWa3JfPyzpsR/UD/e0fC/g2Uy5FGaJg1M8NwtpyM4jrTwr I9YYGiNbV6ctyfoLgGor9lv0jPNRsY1xellFjEZg79EjF/SNjAl5SyEOrUkhMU5Jauvr Dxfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=CcDxclZT+Ks3JwcbvTbM/8mgbIqbve7zsaiHY28IDao=; b=0J/NruDg+aPhpWW6cm1G762vXCym+oqc0JA1rwKYS6+0Ue+BuVtzMXbUY4vfoh50by vih3Sf1v6QKiEp6hhR4j6mLbAzXEkWQn4WevddM3wtJax+mKFf1GMszzUrH15zxcho5z Icai8euuDjzegs8lmRIA+/osWjzyFGzmJelzyjMnZd31k7mKoTsy41k+ahbSKqjgHnZa f1VKUJz8vAAxdq7VQOIVFUS7DiauBsWUr0m74+GOMkpjCt6SQlFuXGhIooaVVcBnKrgj 9D8VUuvbmTBWVA0AqHwVIeCloS1pj3gE6WfPaBTDDGPlvq7DyfPUkjs5rZ4DXw6JLCMx UNbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11-v6si2097884pls.234.2018.07.03.16.49.31; Tue, 03 Jul 2018 16:49:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753637AbeGCXrh (ORCPT + 99 others); Tue, 3 Jul 2018 19:47:37 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46300 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753606AbeGCXrd (ORCPT ); Tue, 3 Jul 2018 19:47:33 -0400 Received: by mail-pf0-f196.google.com with SMTP id l123-v6so1722752pfl.13 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=ayeH1Xoz7Njs74fIObz7MurB5VZpuq4yUF0RToRRKoTv+YZF/pVosffE5kmu5JCcRQ /j5ziJLI6l2vgGqcNBvFrZYs2c7jM3kHmAGZxLZcE0ME0ap7AflF38Wm7tzFo+KvAXGt 54u0KAe2mZBtE66n2+InAD4t7EZ8HDPCmAsYoZiYClUs+e7Wje6r6b2EIhOV/85F3Hss gksE8T1Mv7jnyItuLT6pLEOrOyZqDr/qgehqswlP6b2IlB1xaMm572NiSOGGj+pG8fY3 6zgS1VtgdGG/KwH4TQox8fwPSsvM3cF92p3WkNOzqL9jcaNPDJSB6sqNG2xajol7udxc 29oQ== X-Gm-Message-State: APt69E2YP+bIpSsLeTeh62B4NZmoWoOj0KidVQzkgUVziVpZo7r4P4CJ DNc16RFs3syd1vnEVI+uCnC5dA== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.18.0.203.gfac676dfb9-goog