From patchwork Wed Sep 21 09:42:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 12983518 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B125ECAAD8 for ; Wed, 21 Sep 2022 09:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O9wvLqR9SRMzpM/g0XUQvpEf9e195aL14K53ZPFcsfU=; b=SvPJDxCDk07yPG DTgDuegkGNMskBP9oyZBEdmOL047XnWRJpGr23WwtmECCrtw9Ph69fVC1ptRCTNp1qHXTbmHpU/DY YwA3Yjkf2cqr5A9X8VS4LmwGE84XNuiIrkDMTIgFUzLqi0FeUjveDfVo35bYuacjMYHEOycacYZlA P8Bz2Y4hoLNosr0xtM2+4UxvIvYHhHFFJdTZXT2bzHFMBRu9yTBCLeBXnsUir6sDSk7ESG8V80Xld IzmVk7JAtwZItobi+Vyj2AvFNE/vmMiz6CCamMk3EvGuhRtyCZuXgNkmBN6ft0rISol7Pz5WbkW9p UViM7dGmLVNbt5968V/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oawHd-00AXQm-MO; Wed, 21 Sep 2022 09:44:46 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oawGX-00AWPd-4s for linux-arm-kernel@lists.infradead.org; Wed, 21 Sep 2022 09:43:38 +0000 Received: by mail-wm1-x32e.google.com with SMTP id c2-20020a1c3502000000b003b2973dafb7so8696336wma.2 for ; Wed, 21 Sep 2022 02:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=YzUTWEHUQYeukAyJEfTuM3PzyJlxwwnF0DoykmVbPWw=; b=e20xgygl/W7Al3uqyaecsrMJ91Ab42V4qJSgOrn8Idc7eHJxQinjwe/x6WKSe5oxV4 pvQ6g9h7YLr6xf0iV4G7qRI8F7W/FYWX0wtin2MBV0aW2sJkDBx41zBUhLvG82cGlbH9 n+6BPSzl9EGrkCparVCrg3XLABbSd/hWhMriZ+9U3Phdqsb6Tttf40xPTB/4Y+dDjWRC i4U24vVm6HvhdEy0/iPcIkcb/TKUBMaKJmGF0vSOZrJoqMxFeukfepi8eI/fEKrATb2X qlGWwz9EoZoyDchOaAyu+nc1nQZX425oCa9X1Ybo5mSEGQPk+nRxsTpyNtvtgy5CFhRC zXKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YzUTWEHUQYeukAyJEfTuM3PzyJlxwwnF0DoykmVbPWw=; b=v54WicLhbX02xVlBV6Vth3HsC4aqzFsjGqGcFlV8MWFi5fT5RsNLbJrph69XIZqKcC U15ml8PljCnTXyuwHpf7/GRE9ODkqJRgqgdlaQphob9dW/+1D3oMhUO/tDGub0Pcw03b vcXkGhzJeK6SR87hl/kHJtUDimT0FRkV70VfMu61YjJRxGSoVrsDAYNIq25aMRDi4oOK uiJoHoLfvc9+/nILwI2f5Nv8vydAwbaLGd0X/O+09h9mXiJ8B7Q7sdu4mRBCq4SqJVdd D7aXqU4h4RXOLNjbmaR/7VWSuCEr0GCvhGas91SfFc/9EdxxYR/vfzVNs/qTKhukYODk boxA== X-Gm-Message-State: ACrzQf2BgX3hJtmOZ2rrYHfL0b20gAOB99DDMdKVuLpZaeI+yeEIt1OD wNFFHQNM/tV8mVnQaNvQkZ1QTg== X-Google-Smtp-Source: AMsMyM6rT0cWg1zSdFG4vgNDcbVpnOwWP7a0hP4q6ulsTk1oJ6pe/IvaWqH8AZ6UYJ5Pa6rhxNdigg== X-Received: by 2002:a7b:c404:0:b0:3b4:faca:cf50 with SMTP id k4-20020a7bc404000000b003b4facacf50mr1123082wmi.67.1663753413047; Wed, 21 Sep 2022 02:43:33 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id r123-20020a1c2b81000000b003a62052053csm2763917wmr.18.2022.09.21.02.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 02:43:32 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Amit Kucheria , Alim Akhtar , linux-samsung-soc@vger.kernel.org (open list:SAMSUNG THERMAL DRIVER), linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES) Subject: [PATCH v4 09/30] thermal/drivers/exynos: of_thermal_get_ntrips() Date: Wed, 21 Sep 2022 11:42:22 +0200 Message-Id: <20220921094244.606948-10-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220921094244.606948-1-daniel.lezcano@linaro.org> References: <20220921094244.606948-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_024337_257979_1BCE5B73 X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The thermal core framework allows to get the number of thermal trips, use it instead of visiting the thermal core structure internals. Signed-off-by: Daniel Lezcano Reviewed-by: Krzysztof Kozlowski --- drivers/thermal/samsung/exynos_tmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 0e33d32a9d2e..91e6860b5ec4 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -260,6 +260,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tzd = data->tzd; + int num_trips = thermal_zone_get_num_trips(tzd); unsigned int status; int ret = 0, temp; @@ -271,12 +272,12 @@ static int exynos_tmu_initialize(struct platform_device *pdev) goto out; } - if (of_thermal_get_ntrips(tzd) > data->ntrip) { + if (num_trips > data->ntrip) { dev_info(&pdev->dev, "More trip points than supported by this TMU.\n"); dev_info(&pdev->dev, "%d trip points should be configured in polling mode.\n", - (of_thermal_get_ntrips(tzd) - data->ntrip)); + num_trips - data->ntrip); } mutex_lock(&data->lock); @@ -289,7 +290,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) ret = -EBUSY; } else { int i, ntrips = - min_t(int, of_thermal_get_ntrips(tzd), data->ntrip); + min_t(int, num_trips, data->ntrip); data->tmu_initialize(pdev);