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: 133031 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp168325ljb; Mon, 9 Apr 2018 04:44:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+zfynJiD1WYPoC0I/Ptpvt75WO7CbRSQGb880Vc8CUIvG0DzepTsxrkzdB3yLg5M2lrHXy X-Received: by 2002:a17:902:71cc:: with SMTP id t12-v6mr31254648plm.247.1523274272613; Mon, 09 Apr 2018 04:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523274272; cv=none; d=google.com; s=arc-20160816; b=YFZJY1cNwO5mp6QrkaLPr7RU4+TPjgAAWUXcyG5Z9WuCL5T6MEnwtxPA2MRV9u++Qm URfKspFUIY6lkGu4+UzBQnWmTBb/n7ZjBqZ1V3okfSNqDFTcJYJ8k9YbWcFDczoXB+Lr C2lrG/way66oeZ2llxx630GXoVJZHNcwkclfv9/lsiSdTUdkVKP8BplPhVJnnVqrpwQv wX3wQSjvJGuVS4oi0UTwg9+LJObw9bTGqkJj87NtKPlb1kMia/Nz/Z1EZ+ApZ8Hlt6Bg xfMy9cqsU4MzZzRn89MPAuKsDTKAL4ZQk9nTm1WwxThSxjWRlfvjy8H8rIItY4Uj5OhZ JSJg== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=SXUdyoqeBQisja62usOsgGFOjGqvl1XoLQLEjGJ8Rnk=; b=VZGm+l0e99ciiH9Ew3iBWfMEet8yMd0P/8Zm5uaAv4qbC4sPXjgKHL9GsMPaYn54+p ZBgbwLNa4sQNxTfR1XEx4WuGUOI5rYpkGuG1V84P1IxEBG4xHZLK4NbJlcyjE01+aIMJ Fbpt1pvC1adej8XddqMhnphQ/l1uKymmG9n6L4puUbOKNhFmX4tBiGU47KrHbBd8z5gc Y8uRQ1vPDeg9gw7KPvrvaowZ0nhvZWG07Ox6deLjN/o0Dj5ID9h9vOy+RD1l3KnAEBTr ArXDeYpuUGxLSuP+udfsq4MytfFWn+soDD9mQmVx+ZxKYzzSs3L/H6YeErZEWc88fgYO OFEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J+IuPCAG; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j188si105815pgc.584.2018.04.09.04.44.32; Mon, 09 Apr 2018 04:44:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J+IuPCAG; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbeDILob (ORCPT + 11 others); 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-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 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 --- drivers/base/power/domain.c | 3 +++ include/linux/pm_domain.h | 1 + 2 files changed, 4 insertions(+) -- 2.15.0.194.g9af6a3dea062 Acked-by: Ulf Hansson 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 */