Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754257AbcDVOlL (ORCPT ); Fri, 22 Apr 2016 10:41:11 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:33724 "EHLO mx0a-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbcDVOlJ (ORCPT ); Fri, 22 Apr 2016 10:41:09 -0400 Authentication-Results: ppops.net; spf=none smtp.mail=rf@opensource.wolfsonmicro.com Message-ID: <571A37E6.9070005@opensource.wolfsonmicro.com> Date: Fri, 22 Apr 2016 15:40:38 +0100 From: Richard Fitzgerald User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Mark Brown CC: , , Subject: Re: [PATCH] regulator: core: Add debugfs for regulator always_on flag References: <1461331982-30960-1-git-send-email-rf@opensource.wolfsonmicro.com> <20160422135709.GE3217@sirena.org.uk> In-Reply-To: <20160422135709.GE3217@sirena.org.uk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1604220185 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1316 Lines: 21 On 22/04/16 14:57, Mark Brown wrote: > On Fri, Apr 22, 2016 at 02:33:02PM +0100, Richard Fitzgerald wrote: >> This patch adds a debugfs file for the always_on flag in struct regulator. >> It's useful for debugging to be able to view the state of this flag and >> as it's set by logic inside the regulator core it doesn't necessarily have >> the same value as the always_on flag in constraints. > Why not include this in the same file as the rest of the constraints? > Or why not have one file per constraint (which would be easier for > scripts)? Hmm, well the thing is there's two separate always_on flags, the one in constraints (if you have any constraints) and the one in struct regulator. I could munge the always_on status printed in the constraints debugfs to be (regulator.always_on || constraints.always_on) though I'm not sure if that's helpful (it shows actual state) or confusing (it might not match what was fed in as constraints). >> + ret = snprintf(buf, PAGE_SIZE, "always_on: %u\n", regulator->always_on); >> + debugfs_create_file("always_on", 0444, regulator->debugfs, > It seems to be formatted as though it's going to end up in the same file > but it's a separate file so instead it's just repeating the name of the > file inside the file. Sorry, that was lazy copy-and-paste. I'll fix it.