From patchwork Tue May 23 04:02:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 100351 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp138070qge; Mon, 22 May 2017 21:02:37 -0700 (PDT) X-Received: by 10.98.21.17 with SMTP id 17mr28684017pfv.71.1495512156967; Mon, 22 May 2017 21:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495512156; cv=none; d=google.com; s=arc-20160816; b=gpkE+tdJWh1Mf/Vwrz5YSKLjm+qddaD5BBiHkL1d50hKAJrYNFfVcewWxuNiiT4mob xyoZjuUzX2yXDO1IOHtdpj2KSF0gZN+5t3q8Sqrn0CrpOnQxY/rcBkRMgq7RVhAeAgHl JoryEiiIdvuHhbDRxVBFlhaUNdyH0EV15iSUTKfS78kU1nOwKSQh920wnWEWUSs+E9am XJBm3ICOMqGoT6gb0DceGYS/YMmIYNMgMTRvGEkVhFKoAjd9d+Xrf3+Q4ujcQ+v0hm+q Uri99M836ld3YTVoh+Zh9+i93D6sKNW7WZBWnmwQ/Lght/RFC5snNBvI0ILJloBw06Nc Bq0g== 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=pIcB8KUtH19SR9fm/iFnGr+LoIw2eVy9+ac0TASL1Mo=; b=lhZ26km7nITuQ99AimosPcjWiNP+cBH8ekYCbUFyYoj/QfL/sbvF3nIJHMqbnGlrMR JgaXITm/nLOfIpI7eVF7SP32B5DXwA/LNbOYpLsm0wHyms0D7qKiWiAoMf/KZVoIa/wi MM5cweL1IiRgKPFidX47NQtLAEsG8k5JV/7ZtNVjKKkjzXEnua/heKmzXPDNTuMoJyj6 +2NiuMhUMblvr+ZputUkVAzeOQOa/wfiF8ZQQooIxpw7c3WfEeB9mTQQ/VToqomJtL9H KXStkd5L2r6nl9Pp2zGAvvbV6xMNt3gkMryIWINXK8MeWEnSboa6ctEvqkWHSjvmJ+0l AVNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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=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 g84si18961413pfj.201.2017.05.22.21.02.36; Mon, 22 May 2017 21:02:36 -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; dkim=pass header.i=@linaro.org; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760838AbdEWECe (ORCPT + 25 others); Tue, 23 May 2017 00:02:34 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:36253 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbdEWEC1 (ORCPT ); Tue, 23 May 2017 00:02:27 -0400 Received: by mail-pf0-f178.google.com with SMTP id m17so101264461pfg.3 for ; Mon, 22 May 2017 21:02:27 -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=pIcB8KUtH19SR9fm/iFnGr+LoIw2eVy9+ac0TASL1Mo=; b=NjXuG2niqc1eI9fePcXVXZRohcnKNTMm4cd2WLZcaPDXVgKVvZDJm/lZPqCg5ukN9H uLxVNN48yvwAyPsEvhWYO2iTyNKhggANnuu/+1GTlnB5q2Pc+d5ZBhoM5BG/u15UR0ko hmaYRfFaoSUFxP/YvyAqOQTcfJfzW4h4tmGpU= 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=pIcB8KUtH19SR9fm/iFnGr+LoIw2eVy9+ac0TASL1Mo=; b=QYw2kRok2NyalN3N9ubW8wERtoGg8aFCj44Iyt1KaGxy9Vi8ZkTOE/KRCb+BfFudUz Kt95/aVTkQ6+6Ha464XHFG+9P4ykzollouN8KLR8O3EQYqFNt7XifAfsE/QvyV/Rv+AU JxDjfDGyLA1cnbmeo90bUqeU75E3Zfrgucow8cX6KxhCyg75daRJ0W2Q7tjTM27r+nLf OMNTy/4/OeXwLIMKoxfNh+7ICTZxoHQcDoK3kDTOm5OpJXSnxoyjM9vCRemYRqIECjit L65lmcyEQxN7XVbE1rYE1DRwzVtsKyQeqvlyXhQOFEaSJcLe5CkunwQ46RIRcvhoTQku ENRQ== X-Gm-Message-State: AODbwcA9G0YbbTOHcJz0PegN9eLiiP5RnUim2fzRcY8OJ8XbsAk2MrPE R4QSewhgwXi5GMBe X-Received: by 10.84.218.7 with SMTP id q7mr32601889pli.80.1495512147201; Mon, 22 May 2017 21:02:27 -0700 (PDT) Received: from localhost ([122.167.143.58]) by smtp.gmail.com with ESMTPSA id n65sm38288229pga.8.2017.05.22.21.02.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 May 2017 21:02:26 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot Subject: [PATCH V2 4/4] PM / OPP: Don't create debugfs "supply-0" directory unnecessarily Date: Tue, 23 May 2017 09:32:13 +0530 Message-Id: <0381fc50b84535fcb7964eaa345d2501c5c903b3.1495511998.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.13.0.70.g6367777092d9 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We create "supply-0" debugfs directory even if the device doesn't do voltage scaling. That looks confusing, as if the regulator is found but we never managed to get voltage levels for it. Avoid creating such a directory unnecessarily. Signed-off-by: Viresh Kumar --- drivers/base/power/opp/debugfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.13.0.70.g6367777092d9 diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c index 95f433db4ac7..81cf120fcf43 100644 --- a/drivers/base/power/opp/debugfs.c +++ b/drivers/base/power/opp/debugfs.c @@ -40,11 +40,10 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, struct dentry *pdentry) { struct dentry *d; - int i = 0; + int i; char *name; - /* Always create at least supply-0 directory */ - do { + for (i = 0; i < opp_table->regulator_count; i++) { name = kasprintf(GFP_KERNEL, "supply-%d", i); /* Create per-opp directory */ @@ -70,7 +69,7 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, if (!debugfs_create_ulong("u_amp", S_IRUGO, d, &opp->supplies[i].u_amp)) return false; - } while (++i < opp_table->regulator_count); + } return true; }