Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3343274imm; Tue, 17 Jul 2018 03:15:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe/CgKOlDNdJvECsqwrkc61nUkGyoR1lGmTWmRxTXYWAYZlzkeXIgEllZtqXIYAn/0zAXwA X-Received: by 2002:a17:902:aa07:: with SMTP id be7-v6mr1006258plb.109.1531822508019; Tue, 17 Jul 2018 03:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531822507; cv=none; d=google.com; s=arc-20160816; b=o6IITHbIKUlJDcwRhwqyb+jqRr/0q2JQu13faUDe4BG1Kq4N0Xn5qe++WZNeI+vIgv F5Zsx6HY31MtdOdtWT9jqwz5pgVObYhY2PWWBpns51LO0aqZ7NQMCrtqm6dJLQ3qY+lO YhfKOhpFJ8mjrjtnJ/NZteHGaV28L2ozQdFj/ncJ4i3v2A7pL24to8MBQrqzG1/AsW23 9sJ2vXk8bNDiBU8ZJPoPD5cZkVIJvJ22E6gAuRTwpdDS3BiDFGo2w90Mp7+1bHua65aQ X9rhwdkbIC70QdZMtJcqQUngNjhX5W48M1R9URtpFTXlOkRd8RXK0ps8NbkQ2QmdnIjD U8EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=WfH3ZgLhwu+xoTXF70X3gUOpVc+l6Mcncfd0VLq0bAo=; b=dL1l8jgdc1uQHIl1kXBdZCkciG5fsj8NKmBxB/VNRvfsG/J/vx2V658kaRNPVVy7vO LkMvLVrqZPS9r+hDtfYv5+HujJGbMPZTa8fasjpBiT3Ll/0sm6YpOPjC8vqCJaOmCBKR mUlZWO7s7oo+KHl0xe5DQrVyaE4T/dUe0yEWogF5+bHI4Av6jOpIg2UpwDpljuBikcwL fhOleAYdtnMcSDqOcW+yKdSRA4iwoyVx3XxV1NmWpmwV8JeUKOZW1RQvAyJTaHnH6fnj 5DYc6sju9W1mh8zfB97U+bgopPgRoMcKvd7gvM5aaxuNngAL+NA2AnUP7sao8gFj8y7c drsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uo7P3B0Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6-v6si493578pgp.426.2018.07.17.03.14.52; Tue, 17 Jul 2018 03:15:07 -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=@gmail.com header.s=20161025 header.b=uo7P3B0Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730718AbeGQKow (ORCPT + 99 others); Tue, 17 Jul 2018 06:44:52 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36156 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729703AbeGQKow (ORCPT ); Tue, 17 Jul 2018 06:44:52 -0400 Received: by mail-pf0-f196.google.com with SMTP id d14-v6so289113pfo.3; Tue, 17 Jul 2018 03:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WfH3ZgLhwu+xoTXF70X3gUOpVc+l6Mcncfd0VLq0bAo=; b=uo7P3B0QPXB5GcijvE7nYC3gflJCrrInRSHZCAKM0D5IpD25KWJIrQqGVygpoUr/pX GEUFP/NiV2N6iUImXs2X0S7blnKTbbn2l2APeWSB3pphfaTeWVEa7trAV9IWNTMeqgPF oOMgiw1sG+detQJS7igos1rkX6sBcOHCfZ5yFd+/L3ogUbjah+cCYlPreDG3T84YHhQy crN6hYb4Wzx9mLweToXgT6L1Uo2Jz0xrUOOoHA7yxmFhPFsG/LY9CRcU9A6Rjugs0Gvi ycSRymomVLfmM/7tvFaR7NaIRdZ1949U5f4zgqobSOoM9kNU5Q2ai07kfCrFWJAfA7Tx //Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WfH3ZgLhwu+xoTXF70X3gUOpVc+l6Mcncfd0VLq0bAo=; b=ukJGTVn+0VD42IzBNvh8+f88nVyunK9fC5JGFXHd07CbHrln6ul0e1qOKsLKN06PP4 2TYikAD1ShG6XIgAvcmeZnBmz9J9xV9dqhh45u/bXP32+JnrR6LiGpm0CiRUqncCXYKp 4zpuc+wfRETt7F7ng50SW2ScKcqXbj3fuHCs+psxebf4bit3nqwgtE7sNfCZhrqcCSGb BXjATkqo2wR3EDbX3c5F94irFL5F9XzQpeHAk/oOhOhT7nKtJaClJIwfbrFIt8uSOEft 0w6pw2eXKsYE7cNbiI0ECGHkHl1OgJN0EtwUWNuxd7xA5LkeC0SjjQh0GZ2vw2cIE08t eqzw== X-Gm-Message-State: AOUpUlGcHBNYBskUzTTtLCSMzExjb0b9vkaNajSradnKP8dukRoZKNTH 2xOl6gMwlqIlkbzdOMmCAyI= X-Received: by 2002:a63:b349:: with SMTP id x9-v6mr966111pgt.337.1531822379412; Tue, 17 Jul 2018 03:12:59 -0700 (PDT) Received: from localhost.localdomain ([103.51.74.210]) by smtp.gmail.com with ESMTPSA id 203-v6sm2809963pgb.14.2018.07.17.03.12.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jul 2018 03:12:58 -0700 (PDT) From: Anand Moon To: Bartlomiej Zolnierkiewicz , Zhang Rui , Eduardo Valentin , Kukjin Kim , Krzysztof Kozlowski , Rob Herring , Mark Rutland Cc: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anand Moon Subject: [PATCH 2/5] thermal: exynos: cleanup of clk err check for exynos_tmu_work Date: Tue, 17 Jul 2018 10:12:19 +0000 Message-Id: <1531822342-4293-2-git-send-email-linux.amoon@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531822342-4293-1-git-send-email-linux.amoon@gmail.com> References: <1531822342-4293-1-git-send-email-linux.amoon@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cleanup err check in exynos_tmu_work as clk internal framework will perform if clk is enable/disable so drop the double check of IS_ERR and other such references. CC: Bartlomiej Zolnierkiewicz Signed-off-by: Anand Moon --- drivers/thermal/samsung/exynos_tmu.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 0164c9e..2dbde97 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -300,8 +300,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) mutex_lock(&data->lock); clk_enable(data->clk); - if (!IS_ERR(data->clk_sec)) - clk_enable(data->clk_sec); + clk_enable(data->clk_sec); status = readb(data->base + EXYNOS_TMU_REG_STATUS); if (!status) { @@ -334,8 +333,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) err: clk_disable(data->clk); mutex_unlock(&data->lock); - if (!IS_ERR(data->clk_sec)) - clk_disable(data->clk_sec); + clk_disable(data->clk_sec); out: return ret; } @@ -789,19 +787,16 @@ static void exynos_tmu_work(struct work_struct *work) struct exynos_tmu_data *data = container_of(work, struct exynos_tmu_data, irq_work); - if (!IS_ERR(data->clk_sec)) - clk_enable(data->clk_sec); - if (!IS_ERR(data->clk_sec)) - clk_disable(data->clk_sec); - thermal_zone_device_update(data->tzd, THERMAL_EVENT_UNSPECIFIED); mutex_lock(&data->lock); clk_enable(data->clk); + clk_enable(data->clk_sec); /* TODO: take action based on particular interrupt */ data->tmu_clear_irqs(data); + clk_disable(data->clk_sec); clk_disable(data->clk); mutex_unlock(&data->lock); enable_irq(data->irq); @@ -1134,8 +1129,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) err_sclk: clk_disable_unprepare(data->sclk); err_clk_sec: - if (!IS_ERR(data->clk_sec)) - clk_disable_unprepare(data->clk_sec); + clk_disable_unprepare(data->clk_sec); err_clk: clk_disable_unprepare(data->clk); err_sensor: @@ -1155,8 +1149,7 @@ static int exynos_tmu_remove(struct platform_device *pdev) clk_disable_unprepare(data->sclk); clk_disable_unprepare(data->clk); - if (!IS_ERR(data->clk_sec)) - clk_disable_unprepare(data->clk_sec); + clk_disable_unprepare(data->clk_sec); if (!IS_ERR(data->regulator)) regulator_disable(data->regulator); -- 2.7.4