Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756109AbcCNVQP (ORCPT ); Mon, 14 Mar 2016 17:16:15 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:34007 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817AbcCNVQM (ORCPT ); Mon, 14 Mar 2016 17:16:12 -0400 Date: Mon, 14 Mar 2016 14:16:08 -0700 From: Eduardo Valentin To: Wei Ni Cc: Rui Zhang , Linux PM , LKML , lm-sensors@lm-sensors.org, Stephen Warren , Thierry Reding , Alexandre Courbot , linux-tegra@vger.kernel.org Subject: Re: [PATCH 12/13] thermal: convert tegra_thermal to use devm_thermal_zone_of_sensor_register Message-ID: <20160314211607.GC4740@localhost.localdomain> References: <1457559336-17652-1-git-send-email-edubezval@gmail.com> <1457559336-17652-13-git-send-email-edubezval@gmail.com> <56E1347F.8040406@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Content-Disposition: inline In-Reply-To: <56E1347F.8040406@nvidia.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3909 Lines: 122 --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 10, 2016 at 04:46:55PM +0800, Wei Ni wrote: >=20 >=20 > On 2016=E5=B9=B403=E6=9C=8810=E6=97=A5 05:35, Eduardo Valentin wrote: > > This changes the driver to use the devm_ version > > of thermal_zone_of_sensor_register and cleans > > up the local points and unregister calls. > >=20 > > Cc: Zhang Rui > > Cc: Stephen Warren > > Cc: Thierry Reding > > Cc: Alexandre Courbot > > Cc: linux-pm@vger.kernel.org > > Cc: linux-tegra@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Signed-off-by: Eduardo Valentin > > --- > > drivers/thermal/tegra_soctherm.c | 31 +++++++++---------------------- > > 1 file changed, 9 insertions(+), 22 deletions(-) > >=20 > > diff --git a/drivers/thermal/tegra_soctherm.c b/drivers/thermal/tegra_s= octherm.c > > index 74ea576..0018ccd 100644 > > --- a/drivers/thermal/tegra_soctherm.c > > +++ b/drivers/thermal/tegra_soctherm.c > > @@ -168,7 +168,7 @@ struct tegra_soctherm { > > struct clk *clock_soctherm; > > void __iomem *regs; > > =20 > > - struct thermal_zone_device *thermctl_tzs[4]; > > +#define ZONE_NUMBER 4 > > }; > > =20 > > struct tsensor_shared_calibration { > > @@ -342,7 +342,7 @@ static const struct thermctl_zone_desc t124_thermct= l_temp_zones[] =3D { > > static int tegra_soctherm_probe(struct platform_device *pdev) > > { > > struct tegra_soctherm *tegra; > > - struct thermal_zone_device *tz; > > + struct thermal_zone_device *z; > > struct tsensor_shared_calibration shared_calib; > > struct resource *res; > > unsigned int i; > > @@ -408,36 +408,29 @@ static int tegra_soctherm_probe(struct platform_d= evice *pdev) > > =20 > > /* Initialize thermctl sensors */ > > =20 > > - for (i =3D 0; i < ARRAY_SIZE(tegra->thermctl_tzs); ++i) { > > + for (i =3D 0; i < ZONE_NUMBER; ++i) { > > struct tegra_thermctl_zone *zone =3D > > devm_kzalloc(&pdev->dev, sizeof(*zone), GFP_KERNEL); > > if (!zone) { > > err =3D -ENOMEM; > > - goto unregister_tzs; > > + goto disable_clocks; > > } > > =20 > > zone->reg =3D tegra->regs + t124_thermctl_temp_zones[i].offset; > > zone->shift =3D t124_thermctl_temp_zones[i].shift; > > =20 > > - tz =3D thermal_zone_of_sensor_register(&pdev->dev, i, zone, > > - &tegra_of_thermal_ops); > > - if (IS_ERR(tz)) { > > - err =3D PTR_ERR(tz); > > + z =3D devm_thermal_zone_of_sensor_register(&pdev->dev, i, zone, >=20 > I prefer to still use "tz", it seems this line isn't over 80 characters, = or we > can add newline. Yeah, >=20 > > + &tegra_of_thermal_ops); CHECK: Alignment should match open parenthesis #423: FILE: drivers/thermal/tegra_soctherm.c:423: + tz =3D devm_thermal_zone_of_sensor_register(&pdev->dev, i, zone, + &tegra_of_thermal_ops); and if you align it, then, you get the warning: WARNING: line over 80 characters #423: FILE: drivers/thermal/tegra_soctherm.c:423: + &tegra_of_thermal_ops); And I did not want to add either of the above to the driver.=20 But if you prefer tz over z, we can keep the first (check) then. What do you prefer? --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJW5yoUAAoJEMLUO4d9pOJWaHkIAJuNjRDD8szeiQYLKqZint/c cxUOhuHdIALaINV0dNPJICwQ3BBwiSne4kOCDV4kRtzkWMfE/kxCVvxpzO3DEa7q RfIz78/A4mtE8BuMQ3NRK/NjwQb9co7GcC6ClDUg2mm/O1uADv6F1TAyGOkByFME KiOEoatGfKMODBeICVl4sdW1RjA2RE8QZn1jvXLw/yxz2GVbTyLm6JzOwA8Mqbxi x/9UiQ45IemEYQ2C7orzdeZE41cGrD1yBkVeQ2b6NkLApUn3/ZEJAT048UihAbto 2F3w4PUzZ8Hc216ZEOgjj6cQk0nUZrGmlGaP/Is8iqkjzDfKwlhB4sHF0YOjcrM= =ZPKv -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM--