[Linux-stm32] [PATCH -next 03/15] thermal: brcmstb: use devm_platform_ioremap_resource() to simplify code
YueHaibing
yuehaibing at huawei.com
Wed Sep 4 12:29:27 UTC 2019
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: YueHaibing <yuehaibing at huawei.com>
---
drivers/thermal/broadcom/brcmstb_thermal.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index 5825ac5..de43c3e 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -305,15 +305,13 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
{
struct thermal_zone_device *thermal;
struct brcmstb_thermal_priv *priv;
- struct resource *res;
int irq, ret;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->tmon_base = devm_ioremap_resource(&pdev->dev, res);
+ priv->tmon_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->tmon_base))
return PTR_ERR(priv->tmon_base);
--
2.7.4
More information about the Linux-stm32
mailing list