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: 9741877 X-Patchwork-Delegate: rjw@sisk.pl 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 F34AE60380 for ; Tue, 23 May 2017 04:03:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D92032873B for ; Tue, 23 May 2017 04:03:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC2C82878B; Tue, 23 May 2017 04:03:02 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 5ACC32873B for ; Tue, 23 May 2017 04:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760860AbdEWEC6 (ORCPT ); Tue, 23 May 2017 00:02:58 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34711 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532AbdEWEC1 (ORCPT ); Tue, 23 May 2017 00:02:27 -0400 Received: by mail-pf0-f179.google.com with SMTP id 9so101210913pfj.1 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=elu2Uncm0USxJ3WhS6lJdEdOxvoTpF4glGH1sBOBzprXH543R+Bevs9R7SR72WSgi4 NKiU6T4+njqNHp1j3qACsOnFOWKEWl60sqL7y0OfIc/HxKOgyXirD7EO+FQqz61Kugeu swX5teyz2Yk/tT2qcXWdmn7/adCLl12spUny61GGN/MJQsW7T9fgrMemhjwy+reahshi RrIj0ExpMJ+SM05AyNhblj0+ovq9ohBZhzpwCDXry0Ryrqbr3QTIoSG0j/kgLoMa5LL0 3VJNjJEbta7NdCMUXlyDI+B1pw8K/Oi/UR+KnyZdxclh2eqxB7KTRDiQK/WxuYPHUln1 L3Cg== X-Gm-Message-State: AODbwcDVWbhm72ABsMCSyi6MmZcRWuixtzBllGw367mRrh2Q58L3GgxK DWM/+SXlVUpcEWJO 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Stephen Boyd --- drivers/base/power/opp/debugfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; }