From patchwork Wed May 17 04:40:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 99902 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp63379qge; Tue, 16 May 2017 21:41:14 -0700 (PDT) X-Received: by 10.98.224.136 with SMTP id d8mr1709924pfm.140.1494996073996; Tue, 16 May 2017 21:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494996073; cv=none; d=google.com; s=arc-20160816; b=cpNeAgh9+eOTKQ0yCq/6lrn6BsNDBR2EsAfJVQS3FOnfOnqDRKiaq4dZyX9O/gqFDC zOjVuck1RanjnchKj2614pdK5QK/C9OK1Y7AY/EgEH+oofGpQqd1B2ncRbZ2i18QkQAP XF9fPPCRYqyRkTb2AV0nDvuMHa8m7dlLBedJs1tZ5q/JFzLahsm0ENQtBtaIq9n3lf/d MkHF+OJDA2kb//0V0+AktJeA42yK1yFTVZBxQUvRDKK2FXXki2HSU/fKn0S8mQyQEeNj Z7P5aBe7U5QtNbvOtYD9oTwbUPW2PwiaaSrpLnbShg+hAOUl/+O8mVp/xMI3HUsn5h5X 7YoA== 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=8iBRjsNQkZRSvOzxngvayTBEhaU5b4EZvQnjJ3UT28w=; b=szvkFb61am76VlOTyCypfZfDTTIad/i6XdSkZfecFvxRujLsNTcIc+fGEpvypXi/Q3 +QmlOqNgSQSPiV7XmejTvmgDqQqJ1QjbPxvsziynTcLgNKuG70rSCWDHDb0NYYJ08d69 rfXIY++bJoge5C0IBzs5RI54sDJonl26pqT5yhymZ8x7e+Y9DOjMlxDH/H3tBir4aL+6 I44q5U0pxmvv/iXh9DnQyKUXdfHOT0+2WvXlk55OkH418YxPiDha/prl8vA0dmYk4BoX w7HfPYe4ED4lMHBkG5U8S9kNIaSk9UinIBXFzB/K5W+9RtSIrg/Mzd/s2Qe+UBOMABsy d6vA== 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-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 h79si976926pfh.1.2017.05.16.21.41.13; Tue, 16 May 2017 21:41:13 -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; 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 S1752954AbdEQElK (ORCPT + 14 others); Wed, 17 May 2017 00:41:10 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:33702 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbdEQElF (ORCPT ); Wed, 17 May 2017 00:41:05 -0400 Received: by mail-pf0-f172.google.com with SMTP id e193so1071635pfh.0 for ; Tue, 16 May 2017 21:41:05 -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=8iBRjsNQkZRSvOzxngvayTBEhaU5b4EZvQnjJ3UT28w=; b=gb85wuT/G0O7Kk7uabLeZsTVm/x1QTgHViiJLh1z1h5sDsu2eFItCAZ7fXeU+hG05c JxKSn0IgowWZZVLxu/XVd0xC2cQe+t+b3miRopxWdQn+EYW6r/CGRjTWwwn3oXViSAlB SPVdlDTvhWlJIN07+uUIHdiOw0xf3nYNDnJJk= 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=8iBRjsNQkZRSvOzxngvayTBEhaU5b4EZvQnjJ3UT28w=; b=JREai4GQHT7vzoFQasjKAFFqHn4JrceSu10ZjtNge5e3c6+6bTBwmGvVwI55e1jboY MUtk3pTTaC8HoDVFLHSFvSMljoImuF590+V0sq6rbOapFbGMUGfWA5rbc3OFeW8Q7B0e zTupWrqzyEQPwUUfBwztCVocvIQ9gMrbWO8xqdzHAaCoYo9AEPzLNxCwoLYlP0ZSAsIX O2iFeYQ73MKZd9ZcUtz2l9rqHjK/P0hmUccA3RFq4NpaDcHytOpFu07cEQR2K1C02w3d 1H3YrHEq/vsP2nfirQh8X2QaQsu+EsMRN7f8FrOv8qlh48uRMKBaOjoGyRQLlhEUwkvD mGDQ== X-Gm-Message-State: AODbwcBFkgJRztwMsV+jbhS6i0aQKYxbGLCX4dtY21pRwV0dK00gsSP6 ph9ZNrcc86f3/bt1 X-Received: by 10.84.218.133 with SMTP id r5mr1944852pli.19.1494996064649; Tue, 16 May 2017 21:41:04 -0700 (PDT) Received: from localhost ([122.172.129.253]) by smtp.gmail.com with ESMTPSA id h15sm1028581pfk.120.2017.05.16.21.41.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 May 2017 21:41:04 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Viresh Kumar Subject: [PATCH 4/4] PM / OPP: Don't create debugfs "supply-0" directory unnecessarily Date: Wed, 17 May 2017 10:10:35 +0530 Message-Id: <4365d55b97974c12a51e32b35c2832d664b928b6.1494995911.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.13.0.303.g4ebf3021692d 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 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.13.0.303.g4ebf3021692d diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c index 95f433db4ac7..ce6f4832946b 100644 --- a/drivers/base/power/opp/debugfs.c +++ b/drivers/base/power/opp/debugfs.c @@ -40,11 +40,11 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, struct dentry *pdentry) { struct dentry *d; - int i = 0; + int i = -1; char *name; /* Always create at least supply-0 directory */ - do { + while (++i < opp_table->regulator_count) { name = kasprintf(GFP_KERNEL, "supply-%d", i); /* Create per-opp directory */ @@ -70,7 +70,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; }