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: 8550031 Return-Path: X-Original-To: patchwork-linux-arm@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 C53899F2B4 for ; Wed, 9 Mar 2016 21:39:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9CFF2012B for ; Wed, 9 Mar 2016 21:39:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05C0F200E9 for ; Wed, 9 Mar 2016 21:39:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1adlm6-0001Cd-C6; Wed, 09 Mar 2016 21:36:10 +0000 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adlm3-00019w-5q for linux-arm-kernel@lists.infradead.org; Wed, 09 Mar 2016 21:36:08 +0000 Received: by mail-pa0-x22a.google.com with SMTP id td3so22914983pab.2 for ; Wed, 09 Mar 2016 13:35:46 -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=SbZiWN2A9STkZ+QOqwVfULC3leezQwPnwxVcyet5ZGgiJOPk/d41wkDQsqAbLZ+ABt 1fTKWny4I4oNCI2tJ743jwLFgeZrI+bmvt6DyQ1fbmWMsG/hXV81HAPqrKbk6tmYAbbV oROelAAkFzjz7Nuvwp6qaj/0ajHMdNpAxZbiV5fwodolDTZ3EHWaQDOt2Pr93jX6i3Kv VFn+OzpCO/+4PEWONbJ1mQEK2YpOrIbTiZHCRCYZIN+pQzK2iljLSXhjKysf0EFPmCUy +LtXtNxFCOZvS1AqRzsjGKRE5Rv1mCUNI0v5xphjbp06PZ1h8LsQ6VoqItXagyr39WQZ NtaQ== X-Gm-Message-State: AD7BkJLgS0oj794lDDSSm7YD5usHk3vuVktqjoWJO7PUUeLMQXGTxdnt4uPN8+TYqN2Oog== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160309_133607_264396_7A74B6F7 X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lukasz Majewski , Heiko Stuebner , Linux PM , Jens Thiele , Sascha Hauer , Dmitry Torokhov , LKML , lm-sensors@lm-sensors.org, Eduardo Valentin , Hans de Goede , Chen-Yu Tsai , linux-input@vger.kernel.org, Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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);