Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal management fixes from Zhang Rui.

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
thermal: exynos_thermal: return a proper error code while thermal_zone_device_register fail.
thermal: rcar_thermal: propagate return value of thermal_zone_device_register
Thermal: kirkwood: Convert to devm_ioremap_resource()
Thermal: rcar: Convert to devm_ioremap_resource()
Thermal: dove: Convert to devm_ioremap_resource()
thermal: rcar: fix missing unlock on error in rcar_thermal_update_temp()

+24 -31
+6 -10
drivers/thermal/dove_thermal.c
··· 143 143 if (!priv) 144 144 return -ENOMEM; 145 145 146 - priv->sensor = devm_request_and_ioremap(&pdev->dev, res); 147 - if (!priv->sensor) { 148 - dev_err(&pdev->dev, "Failed to request_ioremap memory\n"); 149 - return -EADDRNOTAVAIL; 150 - } 146 + priv->sensor = devm_ioremap_resource(&pdev->dev, res); 147 + if (IS_ERR(priv->sensor)) 148 + return PTR_ERR(priv->sensor); 151 149 152 150 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 153 151 if (!res) { 154 152 dev_err(&pdev->dev, "Failed to get platform resource\n"); 155 153 return -ENODEV; 156 154 } 157 - priv->control = devm_request_and_ioremap(&pdev->dev, res); 158 - if (!priv->control) { 159 - dev_err(&pdev->dev, "Failed to request_ioremap memory\n"); 160 - return -EADDRNOTAVAIL; 161 - } 155 + priv->control = devm_ioremap_resource(&pdev->dev, res); 156 + if (IS_ERR(priv->control)) 157 + return PTR_ERR(priv->control); 162 158 163 159 ret = dove_init_sensor(priv); 164 160 if (ret) {
+1 -1
drivers/thermal/exynos_thermal.c
··· 476 476 477 477 if (IS_ERR(th_zone->therm_dev)) { 478 478 pr_err("Failed to register thermal zone device\n"); 479 - ret = -EINVAL; 479 + ret = PTR_ERR(th_zone->therm_dev); 480 480 goto err_unregister; 481 481 } 482 482 th_zone->mode = THERMAL_DEVICE_ENABLED;
+3 -5
drivers/thermal/kirkwood_thermal.c
··· 85 85 if (!priv) 86 86 return -ENOMEM; 87 87 88 - priv->sensor = devm_request_and_ioremap(&pdev->dev, res); 89 - if (!priv->sensor) { 90 - dev_err(&pdev->dev, "Failed to request_ioremap memory\n"); 91 - return -EADDRNOTAVAIL; 92 - } 88 + priv->sensor = devm_ioremap_resource(&pdev->dev, res); 89 + if (IS_ERR(priv->sensor)) 90 + return PTR_ERR(priv->sensor); 93 91 94 92 thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0, 95 93 priv, &ops, NULL, 0, 0);
+14 -15
drivers/thermal/rcar_thermal.c
··· 145 145 struct device *dev = rcar_priv_to_dev(priv); 146 146 int i; 147 147 int ctemp, old, new; 148 + int ret = -EINVAL; 148 149 149 150 mutex_lock(&priv->lock); 150 151 ··· 175 174 176 175 if (!ctemp) { 177 176 dev_err(dev, "thermal sensor was broken\n"); 178 - return -EINVAL; 177 + goto err_out_unlock; 179 178 } 180 179 181 180 /* ··· 193 192 dev_dbg(dev, "thermal%d %d -> %d\n", priv->id, priv->ctemp, ctemp); 194 193 195 194 priv->ctemp = ctemp; 196 - 195 + ret = 0; 196 + err_out_unlock: 197 197 mutex_unlock(&priv->lock); 198 - 199 - return 0; 198 + return ret; 200 199 } 201 200 202 201 static int rcar_thermal_get_temp(struct thermal_zone_device *zone, ··· 364 363 struct resource *res, *irq; 365 364 int mres = 0; 366 365 int i; 366 + int ret = -ENODEV; 367 367 int idle = IDLE_INTERVAL; 368 368 369 369 common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); ··· 401 399 /* 402 400 * rcar_has_irq_support() will be enabled 403 401 */ 404 - common->base = devm_request_and_ioremap(dev, res); 405 - if (!common->base) { 406 - dev_err(dev, "Unable to ioremap thermal register\n"); 407 - return -ENOMEM; 408 - } 402 + common->base = devm_ioremap_resource(dev, res); 403 + if (IS_ERR(common->base)) 404 + return PTR_ERR(common->base); 409 405 410 406 /* enable temperature comparation */ 411 407 rcar_thermal_common_write(common, ENR, 0x00030303); ··· 422 422 return -ENOMEM; 423 423 } 424 424 425 - priv->base = devm_request_and_ioremap(dev, res); 426 - if (!priv->base) { 427 - dev_err(dev, "Unable to ioremap priv register\n"); 428 - return -ENOMEM; 429 - } 425 + priv->base = devm_ioremap_resource(dev, res); 426 + if (IS_ERR(priv->base)) 427 + return PTR_ERR(priv->base); 430 428 431 429 priv->common = common; 432 430 priv->id = i; ··· 439 441 idle); 440 442 if (IS_ERR(priv->zone)) { 441 443 dev_err(dev, "can't register thermal zone\n"); 444 + ret = PTR_ERR(priv->zone); 442 445 goto error_unregister; 443 446 } 444 447 ··· 459 460 rcar_thermal_for_each_priv(priv, common) 460 461 thermal_zone_device_unregister(priv->zone); 461 462 462 - return -ENODEV; 463 + return ret; 463 464 } 464 465 465 466 static int rcar_thermal_remove(struct platform_device *pdev)