Received: by 10.192.165.148 with SMTP id m20csp1975420imm; Thu, 26 Apr 2018 04:56:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZozDHFm/XDy8T9U/BNmt4WzLgvvOASe4FkSPA6dxBBg2uHIS3A7mAS0b2GjQdUP/O4ZHIeX X-Received: by 10.98.18.17 with SMTP id a17mr6168542pfj.104.1524743780118; Thu, 26 Apr 2018 04:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524743780; cv=none; d=google.com; s=arc-20160816; b=UL2JTh1MOLwpa64nRdpCImweRpDJC/M7bmcgb5iIEnlq/dSQyhls2pBxGj8LjQM3Fj iQQt8/g+epOsYjA3yQ1/lKhU7kLyN0TCECA3pkl9DKbHq4idn5INomgYD3dTq5aWtx4Z 8DgwwmD9DPx7YbXapKPesoe8/ufMIJ4weQLq0Scqh56YsVbvzXPF2w1+pVhm55CMzKu2 GalfS/gEd1MjkqZb1ZiQPn9R5nIm/K/t8YlFznYodkmLyl5iwCHqwmvMdI7vfTcleUU7 IQg63uvLCM5ewIkKqVQnDBp1rFXAyzjYDv0fNrnrggZ7YsWpgEeGKfMspg31f44eKtLB GZmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=7ZCYUHv6vfBABoDTVxFd1u52RkND9J0BKyx+vpVY/zA=; b=z/RunCEMmjbfGmHdW9NebF+hk4bi7CCWvHeXkADW+0conKNxj6+FjpAVNRv2E+IpJX mdj8iATptnvh9bpkAggMbxz9TwWyGeXy/vUgYdZwMDajkZUpR7sz0ZqusNOuEvJmDq3y 0jcj/vCTdqOhD9Eu/9E6KoZrGuyNPnQlPnO8mbSi5ugvhDHFbZBMdJRMfsOKCnRTMNzy rNuU+2Z1LjnZCF4Lop9N3W51vZIyDCM54rh9H+NG+W3gRZbegur0sEiKmkU/AWwVE0G0 dJIwFuKDv+iOOuR0oB0Y3TGpBA6BW/pyoCpRj57yGnVMwITlpYwIJH+bJv+ZuDP8HXgm 9HaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Qq2mR684; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t184si2620313pfb.98.2018.04.26.04.56.06; Thu, 26 Apr 2018 04:56:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Qq2mR684; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756268AbeDZLxF (ORCPT + 99 others); Thu, 26 Apr 2018 07:53:05 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:48466 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756078AbeDZLwj (ORCPT ); Thu, 26 Apr 2018 07:52:39 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180426115237epoutp0198bdcb4ef69fef09acb7dddf57cdda61~o_i-_F3_Q0449504495epoutp01K; Thu, 26 Apr 2018 11:52:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180426115237epoutp0198bdcb4ef69fef09acb7dddf57cdda61~o_i-_F3_Q0449504495epoutp01K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1524743557; bh=7ZCYUHv6vfBABoDTVxFd1u52RkND9J0BKyx+vpVY/zA=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Qq2mR684kecQ0fdkjXdit9BXFqLf2xda974rglUFCLbpsohNnYPxWWG2lKikiKoty YoOLu8+bB9MpQTWSqwv4yDK2pQcQ/NDL1tJDgGhcHTKXbfxeuAniWNV3TS35J9CmBk xOUhp3Hq/jlkv1LCzX1fOETTYwYZc1d/didynjKE= Received: from epsmges2p2.samsung.com (unknown [182.195.42.70]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20180426115237epcas2p4329e26acf97d71a8db545effd1d5bd78~o_i-e65iF1719317193epcas2p4O; Thu, 26 Apr 2018 11:52:37 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id E3.A4.04132.58DB1EA5; Thu, 26 Apr 2018 20:52:37 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20180426115236epcas2p3764927b3c23113fb4c3771b753a51199~o_i_y0hst1611716117epcas2p3a; Thu, 26 Apr 2018 11:52:36 +0000 (GMT) X-AuditID: b6c32a46-15dff70000001024-d9-5ae1bd858040 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 21.3B.03817.48DB1EA5; Thu, 26 Apr 2018 20:52:36 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P7S00GD7JMBQG00@mmp2.samsung.com>; Thu, 26 Apr 2018 20:52:36 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Eduardo Valentin Cc: Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 15/18] thermal: exynos: check return values of ->get_trip_[temp,hyst] methods Date: Thu, 26 Apr 2018 13:51:30 +0200 Message-id: <1524743493-28113-16-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRmVeSWpSXmKPExsWy7bCmuW7r3odRBof/CFhsnLGe1WL+lWus Fpd3zWGz+Nx7hNFixvl9TBZPHvaxObB57Jx1l91j8Z6XTB59W1YxenzeJBfAEsVlk5Kak1mW WqRvl8CV8ffUF6aCjVwVV87eYW1g3MHRxcjJISFgIjH/xVbWLkYuDiGBHYwSTT92MUI43xkl Hs2bwghT9f7gbXaIxAZGiUvrT7FBOL8YJbrm/GIGqWITsJKY2L4KrENEQEvixKXtTCBFzAJz GCVmNexmAUkIC8RL9C44wQ5iswioSrTd+sIKYvMKeEq8Xv2EHWKdnMTJY5PB4pxA8QtHmlhA BkkI/GWV6Jn5hhWiyEWia0sLG4QtLPHq+BaoZmmJZ6s2MkI0NDNKfNuxhxkiMYFRYs96IQjb WuLw8Ytgg5gF+CQ6Dv8FauYAivNKdLRBlXhI9P+YyARhO0qsub4ErFwI5JtlX/MnMEotYGRY xSiWWlCcm55abFRgpFecmFtcmpeul5yfu4kRHIVabjsYl5zzOcQowMGoxMMbsPBBlBBrYllx Ze4hRgkOZiUR3vjWh1FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeRt8z0QJCaQnlqRmp6YWpBbB ZJk4OKUaGCsTJJ5HnKuWvPFSOiCopmTD5F2BEf3hC8IfPeNVOf8ks3t+bJ/6WfeK0x947X/x 2h35kVjs+GWnsEZVaPYLU5+KnodPn36WLv3nttrJ4coaO+fE3PU7db4u/2Wj1Do/Yee16riT rB3OnQsfX/A0y991WiTisM7eo7xiEXU/Mjzmr7e9dN7poBJLcUaioRZzUXEiAB4d5vO+AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e+xoG7L3odRBufnqlpsnLGe1WL+lWus Fpd3zWGz+Nx7hNFixvl9TBZPHvaxObB57Jx1l91j8Z6XTB59W1YxenzeJBfAEsVlk5Kak1mW WqRvl8CV8ffUF6aCjVwVV87eYW1g3MHRxcjJISFgIvH+4G12EFtIYB2jxIeDkl2MXED2L0aJ 61+nMoMk2ASsJCa2r2IEsUUEtCROXNrOBFLELDCHUeL5ijlMIAlhgXiJ3gUnwCaxCKhKtN36 wgpi8wp4Srxe/YQdYpucxMljk8HinEDxC0eaWCA2e0jc73vPNoGRZwEjwypGydSC4tz03GKj AqO81HK94sTc4tK8dL3k/NxNjMCQ2XZYq38H4+Ml8YcYBTgYlXh4AxY+iBJiTSwrrsw9xCjB wawkwhvf+jBKiDclsbIqtSg/vqg0J7X4EKM0B4uSOC9//rFIIYH0xJLU7NTUgtQimCwTB6dU A6P9o/mHGVfdYf34QsF0q/4deasFAuKKfbdmBP207Y961lo7883UbrZljzZEJpuUaX0pWnWR US9ql2j/qtpI00rrI2tWRmk8O1O1YLZThea2q3cule9On6x4Lft8vNQngcfiR87/bVS7eGKp 1RkpZjdhjn9e0kpKvrtP1Bw/rVDRwlwpwx7b3a/EUpyRaKjFXFScCACneU9rFQIAAA== X-CMS-MailID: 20180426115236epcas2p3764927b3c23113fb4c3771b753a51199 X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180426115236epcas2p3764927b3c23113fb4c3771b753a51199 X-RootMTR: 20180426115236epcas2p3764927b3c23113fb4c3771b753a51199 References: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check return values of ->get_trip_[temp,hyst] methods in exynos_tmu_initialize(). Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/samsung/exynos_tmu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 244aaf6..abe0737 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -357,19 +357,23 @@ static int exynos_tmu_initialize(struct platform_device *pdev) /* Write temperature code for rising and falling threshold */ for (i = 0; i < ntrips; i++) { /* Write temperature code for rising threshold */ - tzd->ops->get_trip_temp(tzd, i, &temp); + ret = tzd->ops->get_trip_temp(tzd, i, &temp); + if (ret) + goto err; temp /= MCELSIUS; data->tmu_set_trip_temp(data, i, temp); /* Write temperature code for falling threshold */ - tzd->ops->get_trip_hyst(tzd, i, &hyst); + ret = tzd->ops->get_trip_hyst(tzd, i, &hyst); + if (ret) + goto err; hyst /= MCELSIUS; data->tmu_set_trip_hyst(data, i, temp, hyst); } data->tmu_clear_irqs(data); } - +err: clk_disable(data->clk); mutex_unlock(&data->lock); if (!IS_ERR(data->clk_sec)) -- 1.9.1