Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5613030ybl; Tue, 10 Dec 2019 08:44:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwFgAdAYoVfbBFe8boH/cGRaJtwNBDoa5wR429t3V4s0lWzXO/MCcUTTgz035fRxUp2fcXR X-Received: by 2002:a9d:7a88:: with SMTP id l8mr27494149otn.187.1575996253121; Tue, 10 Dec 2019 08:44:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575996253; cv=none; d=google.com; s=arc-20160816; b=amgP3B1yOBTifH/AiCjYcD4nyPl6ZBy2U16k9Oq/l1mGOCySf4MiEcw9hz15wIgCAn e+/HP9F0ahoBZe9CQCKSYk+sXIbUjAz+yhs9nxYzYbWT0AUUdbNr5uF7PSC+qnXkAp/S 37XF4WVsldKnlcD9J1E2K5Zo4Zyr0eA3FkS3oHung6/e9qiKiNe1HSLONjM3caITuY9N o320WkXRnZ0GefNNqHz66Pru4QI0vQYz9MEqSaVUCEiYBOGapA8MXP5SB6BT0ykTDuOl jjmuSNDT7uR3YQj83bzKAH8J/9A33o8653lhWDzy93XZnHJUyjjbUWI99NlV+/gKo8Py enAQ== 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=tkuYRLy1ofAGSImjiPenlpmLUxwnT2nMpEQWVPZ5MwQ=; b=gc1Re93VgbuKrZf8yNtlwQNTdse8EgGZiM1BMqajEEwWu/ohRTnQoCMBfVT7nvJgS7 UpGGNHYq2ZkUAvRcT20YqZTNV7Zm6795xxW2Z6Dxt25WSwZfIaRPs2ojs2mP4iPriKbf gC+a+5WeuncZf49f9MsWb6XlmUCJNa5D3OTwBCXjXPCOXl/TqKKLrNv4R8B0DAUx56kw r4GsQJ26rlV5+WvU1pBjdZiCWM3Fw8shJ7XQxEIl2JwLotp7+8/ERzh2o2tu+f+J/zcD 3HlAD8t6Yj43fV+wf6xrloCeWYxqNfA9wqjn4eW0MhYNeC/WNJpQKLjWZfSrQvcEzDYL VmgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y5TxFprY; 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 u8si2319025otq.262.2019.12.10.08.43.59; Tue, 10 Dec 2019 08:44:13 -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=Y5TxFprY; 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 S1727791AbfLJQmU (ORCPT + 99 others); Tue, 10 Dec 2019 11:42:20 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46723 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727777AbfLJQmR (ORCPT ); Tue, 10 Dec 2019 11:42:17 -0500 Received: by mail-pl1-f196.google.com with SMTP id k20so78604pll.13; Tue, 10 Dec 2019 08:42:17 -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=tkuYRLy1ofAGSImjiPenlpmLUxwnT2nMpEQWVPZ5MwQ=; b=Y5TxFprYUtsGWcFEl4Lm6WMCQfOYOqTlZO0TqmCMJv52nHQuC65B7PwNGN/X7VUeDj 4rZnFmto41tnf1t9hzvdjA3+/sP3Tky8i7sBk0Z0kAltU6o8zYHD2HrD8V7v1G0aDZku H290a57FG7kQpf4nip85l2o8uS1Lt1Xri1p8aIhNOViKU9xIRTou7SgJdEbfovylJdwg n8bxvEUKbX3Ct8sGH7m8qwaBypmXAF7wEOtM0/Q+XGIRw68c1k9O1g494pjW5+7nrX6C +PuSQ1+8kDh7ZCPTwphYuBsJYL3FRoh/RYwQv1oPZd3jRKpfuNguRteSnzctA2/GHVi7 X+hQ== 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=tkuYRLy1ofAGSImjiPenlpmLUxwnT2nMpEQWVPZ5MwQ=; b=NbMZ1Vd3MEvU0h8qfc1zEIMPUqvoMbGheiQw5ozgttQo1kkxq/KfSNcK0Nlfre0XcK /qTJ2Eve1tjF5bFfKsehno16+QMipuT5y90f0F8/1Bjb1+1LE6tmOcf7F8nK4Z2xUHO3 bpCvOpPWiY5TMwA/iJ7DpKl9N8C7Gp/Wf/778tdbjzTnPcxzzbyLfemcBJMpjYwzBWXv WvWkkCnOL/yRPY0b7mmahoMvOUvwgr/PlCmsF4GhBkAwxwqMkkf+Qqr72qDM2PzBIrMT UgPuCmIN9gUBr29PEkgFMmXCddbtYiT4nq1MDJMrIZU70T2XB24Dal8w6d0mXk15IxGJ yIgQ== X-Gm-Message-State: APjAAAUStGITNx9EegCTIW+ffo4T+YCGGLqwOqrK/ZzHC5j2wu825cVX En4EAEQEq7ORMqjzosVUwM8= X-Received: by 2002:a17:90a:948a:: with SMTP id s10mr6318285pjo.140.1575996136714; Tue, 10 Dec 2019 08:42:16 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 08:42:15 -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 05/12] thermal: qoriq: Pass data to qoriq_tmu_register_tmu_zone() directly Date: Tue, 10 Dec 2019 08:41:46 -0800 Message-Id: <20191210164153.10463-6-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 Pass all necessary data to qoriq_tmu_register_tmu_zone() directly instead of passing a platform device and then deriving it. This is done as a first step to simplify resource deallocation code. 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index 9886daf8ac97..f024ac68e2ed 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -157,9 +157,9 @@ static const struct thermal_zone_of_device_ops tmu_tz_ops = { .get_temp = tmu_get_temp, }; -static int qoriq_tmu_register_tmu_zone(struct platform_device *pdev) +static int qoriq_tmu_register_tmu_zone(struct device *dev, + struct qoriq_tmu_data *qdata) { - struct qoriq_tmu_data *qdata = platform_get_drvdata(pdev); int id, sites = 0; for (id = 0; id < SITES_MAX; id++) { @@ -169,7 +169,7 @@ static int qoriq_tmu_register_tmu_zone(struct platform_device *pdev) sensor->id = id; - tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, id, + tzd = devm_thermal_zone_of_sensor_register(dev, id, sensor, &tmu_tz_ops); ret = PTR_ERR_OR_ZERO(tzd); @@ -303,7 +303,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev) if (ret < 0) goto err; - ret = qoriq_tmu_register_tmu_zone(pdev); + ret = qoriq_tmu_register_tmu_zone(dev, data); if (ret < 0) { dev_err(dev, "Failed to register sensors\n"); ret = -ENODEV; -- 2.21.0