Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1492686ima; Sun, 21 Oct 2018 13:04:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV616Hq/Icl0w/Oj/UDi3Tv9QBMpQRWilKrf2cfHMEeRjcbRbCzs7aSvlhEoZr0HRq4N+vqZA X-Received: by 2002:a17:902:b692:: with SMTP id c18-v6mr37389710pls.191.1540152246970; Sun, 21 Oct 2018 13:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540152246; cv=none; d=google.com; s=arc-20160816; b=WiIw0uvCl1MzhnMwQpCnqTtcWM1uEzrqaJ6ZPlzXE5lFq/cX4nbihqELf/E67u1zpk jQM5KbQL5cGqRPDneoz3xaiIQydB7A3l7dWmGUgQqmrklyW3dTnYiGEuxObPAv9rygDg cmLLZoAjtD7XOcLHr2T5VtzViHmQwwU7g+Vkk3qhT2G4tLSI+BsKr5FvDoZx4aPWgicB G3+1ezRG9gNpi+bbETSHhTpv+uOFKWzymQkdE0YNlEa7RiFELetQT+zT9rPlOqUvoTnx Si0Owrk/e+d1WzTNq4W6togagDFW+7bVZ3f7VHT5bkRXOaSPIVkh8NKtN/Oi7Pa+7ExD BO6w== 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=aO+5SRf4oHEF2lMLC+v1tLTharxNH9d2FDZydt5mf7Y=; b=eg+mJbkQXvzym28/RCOQICdUYwPsTtK2fWD1U/+Pg7FBxHPFcrB62cWbAxWbv5FI2r YuX7qmkyVZaB5tUv1ILpC1LuWWdE4+MyzzDMF9TDDqiPIXTM2ukUfo1vCKiQcXRe9XgG +7qGr8wYvwRVi7nd886E1gzZOeld4+6EccyfAZb0WN0IaTSl4AfOg/jS4qqlIxmAE/ns NmrYH5G2VF+famdwnVj4prjanrPj+N17wuT/tKLmu/He4v5Y4FBo32ElDxakKI+j25DH QvTXUJPE39O+KO2xhR58wfOOlSz6g6PTiRHIweHFhVRpdwbY3mOeA9WsING86K6qTsB8 h7Lg== 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 k6-v6si32404037pla.156.2018.10.21.13.03.51; Sun, 21 Oct 2018 13:04:06 -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 S1728742AbeJVEQ0 (ORCPT + 99 others); Mon, 22 Oct 2018 00:16:26 -0400 Received: from sauhun.de ([88.99.104.3]:45962 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728644AbeJVEQZ (ORCPT ); Mon, 22 Oct 2018 00:16:25 -0400 Received: from localhost (unknown [90.200.225.72]) by pokefinder.org (Postfix) with ESMTPSA id 393E22E35DF; Sun, 21 Oct 2018 22:00:57 +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 , linux-pm@vger.kernel.org Subject: [PATCH 3/5] thermal: spear_thermal: simplify getting .driver_data Date: Sun, 21 Oct 2018 22:00:50 +0200 Message-Id: <20181021200053.2194-4-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/spear_thermal.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index 81b35aace9de..8b9d567134d0 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -56,8 +56,7 @@ static struct thermal_zone_device_ops ops = { static int __maybe_unused spear_thermal_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); + struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev); struct spear_thermal_dev *stdev = spear_thermal->devdata; unsigned int actual_mask = 0; @@ -73,15 +72,14 @@ static int __maybe_unused spear_thermal_suspend(struct device *dev) static int __maybe_unused spear_thermal_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); + struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev); struct spear_thermal_dev *stdev = spear_thermal->devdata; unsigned int actual_mask = 0; int ret = 0; ret = clk_enable(stdev->clk); if (ret) { - dev_err(&pdev->dev, "Can't enable clock\n"); + dev_err(dev, "Can't enable clock\n"); return ret; } -- 2.19.0