Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5612983ybl; Tue, 10 Dec 2019 08:44:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz7MrPIKnXrnJ1/8U9heKU9L2gdu8TkyPY+8HRopv+QtIs9pPhVeOSmt0n5I7CEtWheD33M X-Received: by 2002:a05:6830:1492:: with SMTP id s18mr27106897otq.285.1575996250402; Tue, 10 Dec 2019 08:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575996250; cv=none; d=google.com; s=arc-20160816; b=KObPL6QPBwxEnHoUUaGCZ4ZNr9po9XwenXx5G0xghs/1w7jeyNsxQu/95RF4JnrycR PCmfDe54wb5ZxhXP4h07lXCPGYyl3jbyaqBepX08viMDaaPtlyrnDLWpcO5P1TckKyRD mkzn9A/q0ihFRwKASJy2Nvr918f+O4JI3OwytMZHySRyyPGWts+jzk9gECwvR66Vh7hz z659vxyuZIBEXIKGNMSkYvtBtgA4mjBAiZwp7T51RTRZOZ3XS5uEq/1IxcBK58obvtFy sCZ1iIJuDSCRxvqYF4SKydQnipSL1l4QFj5t0X9FHobwuRoPBvcXt7+evyWVmGW1DbbG VPUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1CVdA9r3UVKQnabq2mx7w9JDC1aJtWHX+VPZ20Gprac=; b=KetXtP18gALYHeM3Z7+UcMYYXa5GCx61FQNYYFHNCdttZ+7k3/8EBfROEeWjAJXL0/ xYXZDIlqqlQVSrsOdIkeHKknVvRdRWBl1je3l1PJdAV0eBLnvgJdEtFcIzd0+Tx1eUa5 RWfoQdoQLtKI9OtbgjMWnzBsP8mqSlP6E9L7ndbQx4MTNIQ4A0xW22/120crsamlRMea O15vySRJRtpHC1U8HWOQKyIUJisceUycJnJKhfAZoAgmJvmv5LRYhk5OT5PJoi+fl9eA b/QLOEqQ96iKSuAq+d1mk/fk5HP53LbajHh0c319/K+fIVmsAlyx2hwvZkk3G3/FwFNq 7QTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SeHa9vyU; 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 f190si2088289oig.229.2019.12.10.08.43.56; Tue, 10 Dec 2019 08:44:10 -0800 (PST) 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=SeHa9vyU; 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 S1727716AbfLJQmN (ORCPT + 99 others); Tue, 10 Dec 2019 11:42:13 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42312 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727663AbfLJQmL (ORCPT ); Tue, 10 Dec 2019 11:42:11 -0500 Received: by mail-pf1-f194.google.com with SMTP id 4so108837pfz.9; Tue, 10 Dec 2019 08:42:11 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=1CVdA9r3UVKQnabq2mx7w9JDC1aJtWHX+VPZ20Gprac=; b=SeHa9vyU4/5ORBBMIwkil5fZpYyec136edPWMMh+HEhNU6zc9cWB9Qx+uE2+58kuep 5L70XerBhwQ4FqIHu4/ZKmJAHLUSC5TCHhkSQthO8sqZSGZq1uMr1uysm2Ja2IqEMHy8 tpivOuNxjQcQBBqV5puReQtQteCyL1LOCOeAc6A17KDUob4iHSozZYgfDP6Ow9oRBFYY H6/yAgnkrhHH+pvh0rYBjYO6vvZr2om4LWeb2yqNovgMhfbqYXT2vesX9zdU7fXi5S2G ne4MW1Vc9a25MecMJVb0pvi7spG7pa1ER3hzRx7BPXXTXiqCDb8uRtDCHsee5rpoPNXi GqIA== 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:mime-version:content-transfer-encoding; bh=1CVdA9r3UVKQnabq2mx7w9JDC1aJtWHX+VPZ20Gprac=; b=PUYMcwthJgYRSPkHIZVGsDUQZWtnc65S/0YwVe5lX3o7JwSAlYRE7V9yHNnNEcdXdf gTmhN3bnte5HvtSs2Edi3lZ4TmI/x1hSNdmXm6ngE0icgiNL2jDF49354/znKH7eVpxL QPY2vaMrw90sslktaqtlXtjiThxDj3A1ztArFlw/ACkxd16w6ZcuMq4vgJpmcIQYBASW Ck2KLzt0zJ+86oLyyAS+DFdxek78o+m92p6lw5bBJEHRIO7RJJYGTaqjkwC9ykVeg/aV 0tFau2MfZsg85ht7/u+m3neQR8N1S5r+yyfhE1ngoaHGU5PneGWo8aJPyd0dZq3rvsZY IoAg== X-Gm-Message-State: APjAAAUIraUykaEcgWyqu4PNQxEJF0lDl0aRDcyZnPmY3kJf7Fgz96aI M5XPmLG9OzPqXN96z5iz7YE= X-Received: by 2002:a63:28c7:: with SMTP id o190mr24892871pgo.394.1575996130884; Tue, 10 Dec 2019 08:42:10 -0800 (PST) Received: from localhost.localdomain (c-67-165-113-11.hsd1.wa.comcast.net. [67.165.113.11]) by smtp.gmail.com with ESMTPSA id j38sm4034634pgj.27.2019.12.10.08.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 08:42:08 -0800 (PST) From: Andrey Smirnov To: Daniel Lezcano Cc: Andrey Smirnov , Lucas Stach , Chris Healy , Eduardo Valentin , Angus Ainslie , linux-imx@nxp.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 02/12] thermal: qoriq: Don't store struct thermal_zone_device reference Date: Tue, 10 Dec 2019 08:41:43 -0800 Message-Id: <20191210164153.10463-3-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191210164153.10463-1-andrew.smirnov@gmail.com> References: <20191210164153.10463-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Struct thermal_zone_device reference stored as sensor's private data isn't really used anywhere in the code. Drop it. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-imx@nxp.com Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal/qoriq_thermal.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index dd47b31aeecc..2f2f5ffa8f26 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -110,7 +110,6 @@ struct qoriq_tmu_data; * Thermal zone data */ struct qoriq_sensor { - struct thermal_zone_device *tzd; struct qoriq_tmu_data *qdata; int id; }; @@ -162,6 +161,9 @@ static int qoriq_tmu_register_tmu_zone(struct platform_device *pdev) int id, sites = 0; for (id = 0; id < SITES_MAX; id++) { + struct thermal_zone_device *tzd; + int ret; + qdata->sensor[id] = devm_kzalloc(&pdev->dev, sizeof(struct qoriq_sensor), GFP_KERNEL); if (!qdata->sensor[id]) @@ -169,13 +171,16 @@ static int qoriq_tmu_register_tmu_zone(struct platform_device *pdev) qdata->sensor[id]->id = id; qdata->sensor[id]->qdata = qdata; - qdata->sensor[id]->tzd = devm_thermal_zone_of_sensor_register( - &pdev->dev, id, qdata->sensor[id], &tmu_tz_ops); - if (IS_ERR(qdata->sensor[id]->tzd)) { - if (PTR_ERR(qdata->sensor[id]->tzd) == -ENODEV) + + tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, id, + qdata->sensor[id], + &tmu_tz_ops); + ret = PTR_ERR_OR_ZERO(tzd); + if (ret) { + if (ret == -ENODEV) continue; else - return PTR_ERR(qdata->sensor[id]->tzd); + return ret; } if (qdata->ver == TMU_VER1) -- 2.21.0