Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3286879yba; Tue, 23 Apr 2019 00:44:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1+sq1q8mEiEyJWxqSnjiQ0fPQ9BVk4NWogTq938AM8zS+44ZcYELLNO7AckDyw6c0/D/p X-Received: by 2002:a17:902:aa85:: with SMTP id d5mr23784408plr.251.1556005457355; Tue, 23 Apr 2019 00:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556005457; cv=none; d=google.com; s=arc-20160816; b=u27gUctFivDdnf+qXjHOJPHe1u/xT4WsmHJ0SNi0lb6Dpyp97QQrsyX+UZlvc+8rjJ 7xn/Fvl6WlygAoj/KVMrhj5l2+ZXkrF4PaxUlH25MJifuO2IEwYyLKn6gaiH+A/cQAzi j4LI67TUccwMLRbXL9Roh2DlbIq5n3fh/HhUUadpBf60z/W30okw7RMxj96xuFI+BDPV AlWLPv3KxUJPso94lPpw64eKL6EBQjp66+MkN5zlRSZUOLWQexEYziEkvBt35PL+I9Ky oLC0/SkGh2NHnOu4DQ+vu6fsEQz90w2bSH6DxnpttUPgCcz9dw8MOl0+CkhIRtkqgDew M4hg== 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=2jf+tITg5v5FGax+dEPoYHmW3Vn68rccPFWDbk2nlT8=; b=WhP6PIyhvMCPDVqPJrNQPYpPSgdbN1ISbmE3j6oEDowobmIDnVXNAkFC2V2GHn3bx5 RayGa94jAfPqWHQjZ9T8fikYq9gexyDteWDYNXx2v24zoPrnbJ6kz72Q7tfaZdM04hJ5 JOoeplnhbvKFXrdStwJekXQ6rLXTk4eUM18Z0/PzjR3G0fKyA+gYSP5EV6fVFIXchdSL Dwsg1zB5HXt5Mx7nL0NqSIpNelSqPsvrodgJf70RS9z5RGDDNmOmHYwOxSNCd89N4ygX jB5BNLRwTLgiI99oAZhGHYaoklhEDv2oxASPRU4mRe4lfxfOUn1dPEJENH0X5ppU5kpj yL3Q== 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 s24si8112709plp.432.2019.04.23.00.44.01; Tue, 23 Apr 2019 00:44:17 -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 S1727044AbfDWHlS (ORCPT + 99 others); Tue, 23 Apr 2019 03:41:18 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7226 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726698AbfDWHkY (ORCPT ); Tue, 23 Apr 2019 03:40:24 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 48A5FDEEC6CD3E90994B; Tue, 23 Apr 2019 15:40:22 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 15:40:15 +0800 From: Kefeng Wang To: CC: Masahiro Yamada , Kefeng Wang , Zhang Rui , "Eduardo Valentin" , Daniel Lezcano , Subject: [PATCH next 23/25] thermal: Use dev_get_drvdata() Date: Tue, 23 Apr 2019 15:50:18 +0800 Message-ID: <20190423075020.173734-24-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423075020.173734-1-wangkefeng.wang@huawei.com> References: <20190423075020.173734-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using dev_get_drvdata directly. Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: linux-pm@vger.kernel.org Signed-off-by: Kefeng Wang --- .../intel/int340x_thermal/processor_thermal_device.c | 8 +------- drivers/thermal/st/stm_thermal.c | 6 ++---- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c index 8e1cf4d789be..4ad54b8d4778 100644 --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c @@ -81,8 +81,6 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \ struct device_attribute *attr, \ char *buf) \ { \ - struct pci_dev *pci_dev; \ - struct platform_device *pdev; \ struct proc_thermal_device *proc_dev; \ \ if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \ @@ -91,11 +89,7 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \ } \ \ if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \ - pdev = to_platform_device(dev); \ - proc_dev = platform_get_drvdata(pdev); \ - } else { \ - pci_dev = to_pci_dev(dev); \ - proc_dev = pci_get_drvdata(pci_dev); \ + proc_dev = dev_get_drvdata(dev); \ } \ return sprintf(buf, "%lu\n",\ (unsigned long)proc_dev->power_limits[index].suffix * 1000); \ diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c index bbd73c5a4a4e..cf9ddc52f30e 100644 --- a/drivers/thermal/st/stm_thermal.c +++ b/drivers/thermal/st/stm_thermal.c @@ -570,8 +570,7 @@ static int stm_thermal_prepare(struct stm_thermal_sensor *sensor) static int stm_thermal_suspend(struct device *dev) { int ret; - struct platform_device *pdev = to_platform_device(dev); - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev); ret = stm_thermal_sensor_off(sensor); if (ret) @@ -585,8 +584,7 @@ static int stm_thermal_suspend(struct device *dev) static int stm_thermal_resume(struct device *dev) { int ret; - struct platform_device *pdev = to_platform_device(dev); - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev); ret = stm_thermal_prepare(sensor); if (ret) -- 2.20.1