From patchwork Mon Apr 9 11:43:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10331149 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 82E236020F for ; Mon, 9 Apr 2018 11:44:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76C31285F9 for ; Mon, 9 Apr 2018 11:44:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BA2928B1D; Mon, 9 Apr 2018 11:44:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 47923285F9 for ; Mon, 9 Apr 2018 11:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbeDILob (ORCPT ); Mon, 9 Apr 2018 07:44:31 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:45543 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbeDILob (ORCPT ); Mon, 9 Apr 2018 07:44:31 -0400 Received: by mail-pl0-f65.google.com with SMTP id e22-v6so3200653plj.12 for ; Mon, 09 Apr 2018 04:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=SXUdyoqeBQisja62usOsgGFOjGqvl1XoLQLEjGJ8Rnk=; b=J+IuPCAGx1ZfZTJGlBUqLp7WL/q+Tq+U1EX3pdy6Y8NcTHIMuSd+e/GxKMMLNwg/ad jMRdGV00l/t2uzoZWKVSzYH7YpHPwYxJwcFLrOM7TwGnJz6nCvMpJ/0RUPtTYL0LeuEh FEJQ/8gF8e+m9JQ1W3L1gVD0grFfnjokfyzMo= 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:in-reply-to:references; bh=SXUdyoqeBQisja62usOsgGFOjGqvl1XoLQLEjGJ8Rnk=; b=J9cfkvvQTz5IGWG+J7wTVWwU2f8aXCqWzBwE+Bbz6U3YR2eRhBqqBvmSCxNLRnCP0a K4hJQ4RHfgM5xgzlk8EAREqvSdMsnC0+oDLeIudthI+ABI8RJcbr404R2c1UPASaMOn8 9uuFTT0r7KqtAbyS05QVR4XZ7TYbvUMbWosINbz2rDpxndU4763kDhj0/HF/mHSuPB7G 0Ickt8AIdFwA7QsRsgm3T61tpX5gvivY/8KYZEFZtoxHGHLI5NRN2xXskV6NIDgOD6+7 18VXAKfKL9SRHKhwZQ5g2HNKrBhsopClF+mXh+7TmQekrFDVpZ4TTb98b5Hg9hQutUcb fiXg== X-Gm-Message-State: AElRT7HA1udh2+RSRRU/LRA0gciBaxYkDzQrpNmKcceHc1NA+FSYkoHA MZ96rx6NAQsvil4Ryj4iUodMfQ== X-Google-Smtp-Source: AIpwx48gN6RITljFbjk+QR9T+7+YGfYMzgYniA1g2ZnnSgpynQiCGX2Q4c3o1B0ecDckIq1v3CLsbg== X-Received: by 2002:a17:902:41:: with SMTP id 59-v6mr39019898pla.248.1523274270550; Mon, 09 Apr 2018 04:44:30 -0700 (PDT) Received: from localhost ([122.171.228.188]) by smtp.gmail.com with ESMTPSA id j83sm590045pfe.178.2018.04.09.04.44.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 04:44:30 -0700 (PDT) From: Viresh Kumar To: Ulf Hansson , Stephen Boyd , "Rafael J. Wysocki" , Kevin Hilman , Pavel Machek , Len Brown Cc: Viresh Kumar , Rajendra Nayak , Vincent Guittot , linux-pm@vger.kernel.org Subject: [PATCH V2 07/11] PM / Domain: Add struct device to genpd Date: Mon, 9 Apr 2018 17:13:47 +0530 Message-Id: <26cfcef726e24a578768ea75ade5fd9b2fb19254.1523273291.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: 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 The power-domain core would be using the OPP core going forward and the OPP core has the basic requirement of a device structure for its working. Add a struct device to the genpd structure. This doesn't register the device with device core as the "dev" pointer is mostly used by the OPP core as a cookie for now and registering the device is not mandatory. Signed-off-by: Viresh Kumar Acked-by: Ulf Hansson --- drivers/base/power/domain.c | 3 +++ include/linux/pm_domain.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 1ea0e2502e8e..4a3dc9cc0848 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1696,6 +1696,9 @@ int pm_genpd_init(struct generic_pm_domain *genpd, return ret; } + device_initialize(&genpd->dev); + dev_set_name(&genpd->dev, "%s", genpd->name); + mutex_lock(&gpd_list_lock); list_add(&genpd->gpd_list_node, &gpd_list); mutex_unlock(&gpd_list_lock); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 04dbef9847d3..aaacaa35005d 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -49,6 +49,7 @@ struct genpd_power_state { struct genpd_lock_ops; struct generic_pm_domain { + struct device dev; struct dev_pm_domain domain; /* PM domain operations */ struct list_head gpd_list_node; /* Node in the global PM domains list */ struct list_head master_links; /* Links with PM domain as a master */