From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753298AbbDFPY3 (ORCPT ); Mon, 6 Apr 2015 11:24:29 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:52064 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752902AbbDFPY1 (ORCPT ); Mon, 6 Apr 2015 11:24:27 -0400 Date: Mon, 6 Apr 2015 16:24:18 +0100 From: Mark Brown To: Heiko =?iso-8859-1?Q?St=FCbner?= Cc: Liam Girdwood , linux-kernel@vger.kernel.org Message-ID: <20150406152418.GG6023@sirena.org.uk> References: <2348758.yHH02IHytj@diego> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pVF9EYSGkiif4dMH" Content-Disposition: inline In-Reply-To: <2348758.yHH02IHytj@diego> X-Cookie: I've been there. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regulator: add a data summary tree in debugfs X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pVF9EYSGkiif4dMH Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 06, 2015 at 02:04:47AM +0200, Heiko St=FCbner wrote: > + switch (rdev->desc->type) { > + case REGULATOR_VOLTAGE: > + seq_printf(s, "%8dmV ", > + _regulator_get_voltage(rdev) / 1000); > + break; > + case REGULATOR_CURRENT: > + seq_printf(s, "%8dmA ", > + _regulator_get_current_limit(rdev) / 1000); > + break; > + } We have current limits for voltage regulators too. > + if (rdev->desc->type =3D=3D REGULATOR_VOLTAGE) > + seq_printf(s, "%35dmV %8dmV", > + consumer->min_uV / 1000, > + consumer->max_uV / 1000); switch statements please. > + list_for_each_entry(child, list, list) { > + if (!child->supply || child->supply->rdev !=3D rdev) > + continue; Shouldn't we be complaining if the supply of a child isn't the parent? > +static int regulator_summary_show(struct seq_file *s, void *data) > +{ > + struct list_head *list =3D s->private; > + struct regulator_dev *rdev; > + > + seq_puts(s, " regulator use,open,bypass value= min max\n"); I can't help but think that this would look better with spaces rather than commas both here and in the table itself. We also seem to have too much space for the voltages - we're unlikely to see voltages over 10V but the space reserved looks to be enough for 10kV. I think users with such regulators can probably tolerate a little misformatting. --pVF9EYSGkiif4dMH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVIqUhAAoJECTWi3JdVIfQkV0IAIJc5LkceagjBv6iV0QycBLz /R0ngyRJhxetAxu0cPsthZet/tEqqU277RoauXaQhNLGQl2rg+iRxEBcKhNxM4IH gxWJcGRkm9iXOY/GI638ZPKrIkAmQ2uyhJzWh84PxjUOeZ6ro4Ypwg11oMih28TJ xlF7m6Nfvb9U4iKJXLH1zBNtJjLYr6GFXG5OwXEzJz2ffxwt0MOROKkFQzEJHaBc fRqN4EYyRTNU7sj1sUetFlNH3DobAvNGic/Yt1vSPjNJsduDYj6iVL5Aq381NQvm ZjaAdNaC8n0bns84tu7BHh+4Yvl3UC++cCgmJnIRN8nzSV0GDVwOYyTW2a/XJe0= =28nd -----END PGP SIGNATURE----- --pVF9EYSGkiif4dMH--