Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934279AbcCIVjR (ORCPT ); Wed, 9 Mar 2016 16:39:17 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33551 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754019AbcCIVfs (ORCPT ); Wed, 9 Mar 2016 16:35:48 -0500 From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , lm-sensors@lm-sensors.org, Eduardo Valentin Subject: [PATCH 06/13] thermal: convert hisi_thermal to use devm_thermal_zone_of_sensor_register Date: Wed, 9 Mar 2016 13:35:28 -0800 Message-Id: <1457559336-17652-7-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457559336-17652-1-git-send-email-edubezval@gmail.com> References: <1457559336-17652-1-git-send-email-edubezval@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1357 Lines: 37 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: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin --- drivers/thermal/hisi_thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index 36d0729..c9b2f81 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -243,8 +243,8 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, sensor->id = index; sensor->thermal = data; - sensor->tzd = thermal_zone_of_sensor_register(&pdev->dev, sensor->id, - sensor, &hisi_of_thermal_ops); + sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, + sensor->id, sensor, &hisi_of_thermal_ops); if (IS_ERR(sensor->tzd)) { ret = PTR_ERR(sensor->tzd); dev_err(&pdev->dev, "failed to register sensor id %d: %d\n", @@ -364,7 +364,6 @@ static int hisi_thermal_remove(struct platform_device *pdev) struct hisi_thermal_sensor *sensor = &data->sensors[i]; hisi_thermal_toggle_sensor(sensor, false); - thermal_zone_of_sensor_unregister(&pdev->dev, sensor->tzd); } hisi_thermal_disable_sensor(data); -- 2.1.4