Received: by 10.192.165.156 with SMTP id m28csp763675imm; Thu, 19 Apr 2018 07:12:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/cjEg8miLDQMpOwVMHGvsbGAb1kkdmt5Vr+I8C7T7q5+JsJUBEh1z8ZM+7u3CHX/UuRSqh X-Received: by 10.99.109.65 with SMTP id i62mr5290600pgc.233.1524147157849; Thu, 19 Apr 2018 07:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147157; cv=none; d=google.com; s=arc-20160816; b=qkolsjjKID7wrB927Bb/AaFVxAxrAaUsKnAdSd8dSlPc2mW24TekvubtbexXx/xEAu JgRaqNBSzR1f2WgpXaWEb0ddK4MHhh0gOlUD9JkCiHUiIn3CSYQcKAd6fgEaw6hT780x /oX3LSmSaJ4EPycyCv5fCBOmhWk4zq0J47foENujk5P+KEc4cL4d5faciUlEHrRh48aY hfCkJIW4+TRZD5bD8bZD+JT/3JsCKO4+yjamnm1gr3yXmCoAhy9oHeiKV0Sx/A83sSCf 3BJ3fmJUyjpUjkYeU6N4XWDwFUASdALVT8fCYDNdW/r8+1Rdmx04MjA+I3lNviTITXEs GNBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=OS1yx5vLmBMTLJRsNQcCOBPsrYLt2bR9tsIQeVqaduw=; b=fUI5OqGa0xn4Ix1PllMDyhCJD5fSh9b17vFQzT7Y9iIXIluJ1clas4QCbZnu1s6RJs JdqHAR/mVDbsjWP7Z0n7JRIoRSlapzEv03/kDk8kfAul6zYL21zdE6X+i+qeCqW4qvYy D2AhFzSZ9bCfFvVlWJibEDQX0/9FB1vBiCUZ8ixcVZFZRlGRDcDp0c6QxrgQf1vW+mrG XTVjkXropj39jh7LETOzUn5ZqghAc9qrqwQEVJGSwe9+M9KMHpjnDmMN/X+kBYACAxkk qy7qZC8qom7h5HKxes9yFfmLeEHtR+Jp6hUr5wA0fW0wCf4OBqYp8BGedC/wfyKpo1vj jcPw== 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 w20-v6si3565242plp.7.2018.04.19.07.12.24; Thu, 19 Apr 2018 07:12:37 -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 S1753828AbeDSOKb (ORCPT + 99 others); Thu, 19 Apr 2018 10:10:31 -0400 Received: from sauhun.de ([88.99.104.3]:45448 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753557AbeDSOHN (ORCPT ); Thu, 19 Apr 2018 10:07:13 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id D03CB3139D9; Thu, 19 Apr 2018 16:07:11 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Zhang Rui , Eduardo Valentin , linux-pm@vger.kernel.org Subject: [PATCH 52/61] thermal: st: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:22 +0200 Message-Id: <20180419140641.27926-53-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get drvdata 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. Please apply individually. drivers/thermal/st/st_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index be637e6b01d2..b2bbdf6eb02b 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -277,8 +277,7 @@ EXPORT_SYMBOL_GPL(st_thermal_unregister); #ifdef CONFIG_PM_SLEEP static int st_thermal_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct st_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct st_thermal_sensor *sensor = dev_get_drvdata(dev); return st_thermal_sensor_off(sensor); } @@ -286,8 +285,7 @@ static int st_thermal_suspend(struct device *dev) static int st_thermal_resume(struct device *dev) { int ret; - struct platform_device *pdev = to_platform_device(dev); - struct st_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct st_thermal_sensor *sensor = dev_get_drvdata(dev); ret = st_thermal_sensor_on(sensor); if (ret) -- 2.11.0