From patchwork Fri Mar 17 15:52:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9631005 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 26A52602D6 for ; Fri, 17 Mar 2017 15:56:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BFA8286BF for ; Fri, 17 Mar 2017 15:56:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10A1A286D4; Fri, 17 Mar 2017 15:56:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBB37286D0 for ; Fri, 17 Mar 2017 15:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751061AbdCQP4z (ORCPT ); Fri, 17 Mar 2017 11:56:55 -0400 Received: from smtp-4.sys.kth.se ([130.237.48.193]:54566 "EHLO smtp-4.sys.kth.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbdCQP4y (ORCPT ); Fri, 17 Mar 2017 11:56:54 -0400 Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1]) by smtp-4.sys.kth.se (Postfix) with ESMTP id 19E6135DF; Fri, 17 Mar 2017 16:53:24 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-4.sys.kth.se ([127.0.0.1]) by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BsKQOdyXQu1B; Fri, 17 Mar 2017 16:53:23 +0100 (CET) X-KTH-Auth: niso [89.233.230.99] X-KTH-mail-from: niklas.soderlund+renesas@ragnatech.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 332733603; Fri, 17 Mar 2017 16:53:23 +0100 (CET) From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: linux-pm@vger.kernel.org, Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, Zhang Rui , Eduardo Valentin , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v2 6/7] thermal: rcar_gen3_thermal: store device match data in private structure Date: Fri, 17 Mar 2017 16:52:59 +0100 Message-Id: <20170317155300.21566-7-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170317155300.21566-1-niklas.soderlund+renesas@ragnatech.se> References: <20170317155300.21566-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The device match data needs to be accessible outside the probe function, store it in the private data structure. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang --- drivers/thermal/rcar_gen3_thermal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index dc019b7873273cf2..438fb9988eabb91b 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -85,6 +85,7 @@ struct rcar_gen3_thermal_tsc { }; struct rcar_gen3_thermal_priv { + const struct rcar_gen3_thermal_data *data; spinlock_t lock; /* Protect interrupts on and off */ unsigned int num_tscs; struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM]; @@ -353,8 +354,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) struct thermal_zone_device *zone; int ret, irq, i; char *irqname; - const struct rcar_gen3_thermal_data *match_data = - of_device_get_match_data(dev); /* default values if FUSEs are missing */ /* TODO: Read values from hardware on supported platforms */ @@ -369,6 +368,8 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + priv->data = of_device_get_match_data(dev); + spin_lock_init(&priv->lock); platform_set_drvdata(pdev, priv); @@ -414,7 +415,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) priv->tscs[i] = tsc; - match_data->thermal_init(tsc); + priv->data->thermal_init(tsc); rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]); zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,