Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1491782ima; Sun, 21 Oct 2018 13:03:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Ohqf1hjQuQixLZjguq/Bp6Xlqb7hg3E09mY0aTkSJrR6HXjyXyBYh5YFzkQw+jHl1FANZ X-Received: by 2002:a63:d00b:: with SMTP id z11-v6mr41020387pgf.317.1540152182486; Sun, 21 Oct 2018 13:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540152182; cv=none; d=google.com; s=arc-20160816; b=EQlNGGOevIh+ziKFdTSQsSrIEtJd+xToYIyFd/yd/2caaaykO9lbUNOHFlVzBcJLFo xmTHQYbynDnhT/MHzVkSrWlmhcFmLk9dAd5SfDQYhvpbo74yL3FiZh+JTEXQ1WpejIVf k8ua80NCuc39c7XHzDId4K77Eewun9fe6X7jl4oPHP8RtwmLlAa/U3XFgCVzyLP4pWMD oswNvE1C2iFwmKv9l5XY+6YDoJBZgbP/u1GofJzNfeY1nH5O9X8cGXknPKk4Vu6uXHqJ ZLpzmruD6NbLtoJuXZ42ANRWDLlmpPvj64ZW8K+gcgyziqYDlbfFexHWPqrQy8C9oB5J ayvg== 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; bh=ndqKPjRtYjn6KDyMmd0CMLZ0gknITKv5Fe5gRFvzro0=; b=QXAiVEDjItK5jajJcWxvlhRazBpMgmRikmsH+2UpzCUR+ifs3GFQ29VK8dcLACBU0I q/2jW27besYOKma3obSiwiWLNdzhWKoDaB4O9tn9fS8deyZcMjCA7/wjVCqo53prvO2y xKX0+vfG8S8nPht/raWjRdIQuil0NXoOW1trc/5D6ci2R3fs3tikywYnmDjEvocwiw2G nlRUICsGI3huL2ZZIK+VeFvs2LRRdlYzSVHTn/+3cW2tDrdW8ZbTA+PmMPvcDN5mxpBL W9yawUjSPTKaOr/684xoLJ52OKYfMG2Il79etEPzg4Myt9Xujo5Jy9hqm/EosZSDEjWL 8siQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13-v6si31231053pgj.399.2018.10.21.13.02.47; Sun, 21 Oct 2018 13:03:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728877AbeJVERW (ORCPT + 99 others); Mon, 22 Oct 2018 00:17:22 -0400 Received: from sauhun.de ([88.99.104.3]:45948 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728700AbeJVEQZ (ORCPT ); Mon, 22 Oct 2018 00:16:25 -0400 Received: from localhost (unknown [90.200.225.72]) by pokefinder.org (Postfix) with ESMTPSA id 47A402E35DE; Sun, 21 Oct 2018 22:00:56 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Heiko Stuebner , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH 2/5] thermal: rockchip_thermal: simplify getting .driver_data Date: Sun, 21 Oct 2018 22:00:49 +0200 Message-Id: <20181021200053.2194-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181021200053.2194-1-wsa+renesas@sang-engineering.com> References: <20181021200053.2194-1-wsa+renesas@sang-engineering.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 We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. drivers/thermal/rockchip_thermal.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index f36375d5a16c..9c7643d62ed7 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1327,8 +1327,7 @@ static int rockchip_thermal_remove(struct platform_device *pdev) static int __maybe_unused rockchip_thermal_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev); + struct rockchip_thermal_data *thermal = dev_get_drvdata(dev); int i; for (i = 0; i < thermal->chip->chn_num; i++) @@ -1346,8 +1345,7 @@ static int __maybe_unused rockchip_thermal_suspend(struct device *dev) static int __maybe_unused rockchip_thermal_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev); + struct rockchip_thermal_data *thermal = dev_get_drvdata(dev); int i; int error; @@ -1376,7 +1374,7 @@ static int __maybe_unused rockchip_thermal_resume(struct device *dev) id, thermal->regs, thermal->tshut_temp); if (error) - dev_err(&pdev->dev, "%s: invalid tshut=%d, error=%d\n", + dev_err(dev, "%s: invalid tshut=%d, error=%d\n", __func__, thermal->tshut_temp, error); } -- 2.19.0