| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ZTE's zx2967 family thermal sensor driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2017 ZTE Ltd. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Baoyou Xie <baoyou.xie@linaro.org> |
|---|
| 7 | | - * |
|---|
| 8 | | - * License terms: GNU General Public License (GPL) version 2 |
|---|
| 9 | 8 | */ |
|---|
| 10 | 9 | |
|---|
| 11 | 10 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 46 | 45 | * @clk_topcrm: topcrm clk structure |
|---|
| 47 | 46 | * @clk_apb: apb clk structure |
|---|
| 48 | 47 | * @regs: pointer to base address of the thermal sensor |
|---|
| 48 | + * @dev: struct device pointer |
|---|
| 49 | 49 | */ |
|---|
| 50 | 50 | |
|---|
| 51 | 51 | struct zx2967_thermal_priv { |
|---|
| .. | .. |
|---|
| 207 | 207 | #ifdef CONFIG_PM_SLEEP |
|---|
| 208 | 208 | static int zx2967_thermal_suspend(struct device *dev) |
|---|
| 209 | 209 | { |
|---|
| 210 | | - struct platform_device *pdev = to_platform_device(dev); |
|---|
| 211 | | - struct zx2967_thermal_priv *priv = platform_get_drvdata(pdev); |
|---|
| 210 | + struct zx2967_thermal_priv *priv = dev_get_drvdata(dev); |
|---|
| 212 | 211 | |
|---|
| 213 | 212 | if (priv && priv->clk_topcrm) |
|---|
| 214 | 213 | clk_disable_unprepare(priv->clk_topcrm); |
|---|
| .. | .. |
|---|
| 221 | 220 | |
|---|
| 222 | 221 | static int zx2967_thermal_resume(struct device *dev) |
|---|
| 223 | 222 | { |
|---|
| 224 | | - struct platform_device *pdev = to_platform_device(dev); |
|---|
| 225 | | - struct zx2967_thermal_priv *priv = platform_get_drvdata(pdev); |
|---|
| 223 | + struct zx2967_thermal_priv *priv = dev_get_drvdata(dev); |
|---|
| 226 | 224 | int error; |
|---|
| 227 | 225 | |
|---|
| 228 | 226 | error = clk_prepare_enable(priv->clk_topcrm); |
|---|