[PATCH -next 04/15] thermal: hisilicon: use devm_platform_ioremap_resource() to simplify code

YueHaibing
2019-09-04T12:34:41Z

drivers/thermal/hisi_thermal.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 2d26ae8..8c0e002 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -557,7 +557,6 @@ static int hisi_thermal_probe(struct platform_device *pdev)
{
struct hisi_thermal_data *data;
struct device *dev = &pdev->dev;
- struct resource *res;
int i, ret;

data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -568,8 +567,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, data);
data->ops = of_device_get_match_data(dev);

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- data->regs = devm_ioremap_resource(dev, res);
+ data->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(data->regs)) {
dev_err(dev, "failed to get io address\n");
return PTR_ERR(data->regs);
--
2.7.4