From patchwork Wed Mar 9 21:35:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 8549721 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0730E9F2B4 for ; Wed, 9 Mar 2016 21:36:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0388A20114 for ; Wed, 9 Mar 2016 21:35:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2F4920121 for ; Wed, 9 Mar 2016 21:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754055AbcCIVfz (ORCPT ); Wed, 9 Mar 2016 16:35:55 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:33535 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754005AbcCIVfr (ORCPT ); Wed, 9 Mar 2016 16:35:47 -0500 Received: by mail-pa0-f54.google.com with SMTP id fl4so49394684pad.0; Wed, 09 Mar 2016 13:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JrD3wrEOfx+KOwISiCTtYmci2Kalx8vr7fJmg0RotB8=; b=zz+FOmkK4U7NDyvFYK8CEtELf5Yo2tsqGkgVJ7D9Glc57mOKlQW4OG8yysD5k6/t1h EDp3J+kFLPwl3yAhTy/joEtvj8nJaqPaVjxX1o3JYx6ZXSOzzGgN7peBQLcaz0QDFQG6 d80X4IkubwWdcsliTO2Lq+q5crD85xoC4hJRYVclEOjspVWo9LPX3JZl3Awauofb9TDN kyKiniVOWe00t9lNFW3YGxxF954c40F8MEET2zZJ3bAiMRX021yIDHCQmsZachjsOjbD IfklQAgw7tNYzzpCDqIFSPFBN1oszsJtwXGGgjabsEEzijKYp1TXF7MRzsKR+NpcO5zI NT3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JrD3wrEOfx+KOwISiCTtYmci2Kalx8vr7fJmg0RotB8=; b=U4lvBfAfsMqmP68qVzwXftESVFiVvyeDSW+kpWrLrZvBebNWGNHq4Y4eCzm54irQCo AoMG7FI0wvg8RFvNcR1sDbyNDeSNfG+q5hyRgt5pjJGqoQP0lZgp5cTLr7VTXIPgvjxw FYU3/0CYSI/xOMqwbHDKnywFwkv3TdfgBFSuxM566d+hsBO1APq1p52rfrXEOEueS3YV 2zg45LJHhy4KVJ6iVsBSX6ZU5rObeaGhGPFtNkW1sOOw/9ZiHXw9BbxUj7k7xs72ltfQ fVXtNT9ek39hU0XwdcTuf0QF9ij/0ZM0micFRejA/2yBJkG2pt2+maCx9XNZpHTzwGOk 8O4A== X-Gm-Message-State: AD7BkJIG6vU6i9cuvBDHsmIiszqMAj9X7BwaYvom6Z7Ydc3wjZ249WG+Prj+hO+vVhogIw== X-Received: by 10.67.5.9 with SMTP id ci9mr581708pad.101.1457559345960; Wed, 09 Mar 2016 13:35:45 -0800 (PST) Received: from localhost ([209.119.72.78]) by smtp.gmail.com with ESMTPSA id 16sm388396pfk.28.2016.03.09.13.35.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2016 13:35:45 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , lm-sensors@lm-sensors.org, Eduardo Valentin , Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Hans de Goede , Lukasz Majewski , Heiko Stuebner , Sascha Hauer , Jens Thiele , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register Date: Wed, 9 Mar 2016 13:35:27 -0800 Message-Id: <1457559336-17652-6-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-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Dmitry Torokhov Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Hans de Goede Cc: Zhang Rui Cc: Lukasz Majewski Cc: Heiko Stuebner Cc: Sascha Hauer Cc: Jens Thiele Cc: linux-input@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin Acked-by: Dmitry Torokhov Acked-by: Hans de Goede --- drivers/input/touchscreen/sun4i-ts.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c index 4857943..d07dd29 100644 --- a/drivers/input/touchscreen/sun4i-ts.c +++ b/drivers/input/touchscreen/sun4i-ts.c @@ -115,7 +115,6 @@ struct sun4i_ts_data { struct device *dev; struct input_dev *input; - struct thermal_zone_device *tz; void __iomem *base; unsigned int irq; bool ignore_fifo_data; @@ -366,10 +365,7 @@ static int sun4i_ts_probe(struct platform_device *pdev) if (IS_ERR(hwmon)) return PTR_ERR(hwmon); - ts->tz = thermal_zone_of_sensor_register(ts->dev, 0, ts, - &sun4i_ts_tz_ops); - if (IS_ERR(ts->tz)) - ts->tz = NULL; + devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops); writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC); @@ -377,7 +373,6 @@ static int sun4i_ts_probe(struct platform_device *pdev) error = input_register_device(ts->input); if (error) { writel(0, ts->base + TP_INT_FIFOC); - thermal_zone_of_sensor_unregister(ts->dev, ts->tz); return error; } } @@ -394,8 +389,6 @@ static int sun4i_ts_remove(struct platform_device *pdev) if (ts->input) input_unregister_device(ts->input); - thermal_zone_of_sensor_unregister(ts->dev, ts->tz); - /* Deactivate all IRQs */ writel(0, ts->base + TP_INT_FIFOC);