Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755663AbcCNTuE (ORCPT ); Mon, 14 Mar 2016 15:50:04 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:36690 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755787AbcCNTtu (ORCPT ); Mon, 14 Mar 2016 15:49:50 -0400 Date: Mon, 14 Mar 2016 12:49:46 -0700 From: Eduardo Valentin To: Guenter Roeck Cc: Rui Zhang , Linux PM , LKML , lm-sensors@lm-sensors.org, Jean Delvare Subject: Re: [PATCH 04/13] hwmon: convert scpi-hwmon to use devm_thermal_zone_of_sensor_register Message-ID: <20160314194945.GG1872@localhost.localdomain> References: <1457559336-17652-1-git-send-email-edubezval@gmail.com> <1457559336-17652-5-git-send-email-edubezval@gmail.com> <56E0DBFD.7060903@roeck-us.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RE3pQJLXZi4fr8Xo" Content-Disposition: inline In-Reply-To: <56E0DBFD.7060903@roeck-us.net> 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: 3203 Lines: 102 --RE3pQJLXZi4fr8Xo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 09, 2016 at 06:29:17PM -0800, Guenter Roeck wrote: > On 03/09/2016 01:35 PM, 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. > > > >Cc: Jean Delvare > >Cc: Guenter Roeck > >Cc: lm-sensors@lm-sensors.org > >Cc: linux-kernel@vger.kernel.org > >Signed-off-by: Eduardo Valentin > >--- > > drivers/hwmon/scpi-hwmon.c | 41 ++++++++------------------------------= --- > > 1 file changed, 8 insertions(+), 33 deletions(-) > > > >diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c > >index 7e20567..2309e47 100644 > >--- a/drivers/hwmon/scpi-hwmon.c > >+++ b/drivers/hwmon/scpi-hwmon.c > >@@ -31,10 +31,8 @@ struct sensor_data { > > }; > > > > struct scpi_thermal_zone { > >- struct list_head list; > > int sensor_id; > > struct scpi_sensors *scpi_sensors; > >- struct thermal_zone_device *tzd; > > }; > > > > struct scpi_sensors { > >@@ -92,20 +90,6 @@ scpi_show_label(struct device *dev, struct device_att= ribute *attr, char *buf) > > return sprintf(buf, "%s\n", sensor->info.name); > > } > > > >-static void > >-unregister_thermal_zones(struct platform_device *pdev, > >- struct scpi_sensors *scpi_sensors) > >-{ > >- struct list_head *pos; > >- > >- list_for_each(pos, &scpi_sensors->thermal_zones) { > >- struct scpi_thermal_zone *zone; > >- > >- zone =3D list_entry(pos, struct scpi_thermal_zone, list); > >- thermal_zone_of_sensor_unregister(&pdev->dev, zone->tzd); > >- } > >-} > >- > > static struct thermal_zone_of_device_ops scpi_sensor_ops =3D { > > .get_temp =3D scpi_read_temp, > > }; > >@@ -224,6 +208,7 @@ static int scpi_hwmon_probe(struct platform_device *= pdev) > > INIT_LIST_HEAD(&scpi_sensors->thermal_zones); > > for (i =3D 0; i < nr_sensors; i++) { > > struct sensor_data *sensor =3D &scpi_sensors->data[i]; > >+ struct thermal_zone_device *z; > > struct scpi_thermal_zone *zone; > > > > if (sensor->info.class !=3D TEMPERATURE) > >@@ -232,42 +217,33 @@ static int scpi_hwmon_probe(struct platform_device= *pdev) > > zone =3D devm_kzalloc(dev, sizeof(*zone), GFP_KERNEL); > > if (!zone) { > > ret =3D -ENOMEM; > >- goto unregister_tzd; > >+ goto mfail; >=20 > return -ENOMEM; >=20 > ... and drop the unnecessary label. True. I will change as requested. Thanks --RE3pQJLXZi4fr8Xo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJW5xXVAAoJEMLUO4d9pOJW6poH/1ffws8u4lxp7CLo0q/7A+/Y vhfwm78PDxNzimEh8owH1F8eIdgi30+9s2h0AThsU2qwzzgsvw3z2LID3Z5YyCQk atQKjj0ykH/FrzR3cpc7aGsb8s+r9xcdS0R/tzEfywxG5wDKlMLsP+zAxJHHIM2L M2C+H+0BQxz/yrhzK9eSMQwwXqKEb0MdsaXDqxMaeJzSgpl38HOwS76NwnZPkdmI 72ymPBQ5Q4PvjWt5sMP8//VolHjpbY3ZqOBdFolV/bN5GsLNyj/tHlhnOm5B/pWT 5dhpRo6DWH9CeJNRGNXBOb7oHVNjgN9rz9FiKrHnqXH4cqS1JZK1vHOkzJwNhHg= =1nTO -----END PGP SIGNATURE----- --RE3pQJLXZi4fr8Xo--