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 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal

Pull thermal SoC fixes from Eduardo Valentin:
"Fixes for armada and broadcom thermal drivers"

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
thermal: broadcom: constify thermal_zone_of_device_ops structure
thermal: armada: constify thermal_zone_of_device_ops structure
thermal: bcm2835: Switch to SPDX identifier
thermal: armada: fix legacy resource fixup
thermal: armada: fix legacy validity test sense

+15 -26
+13 -15
drivers/thermal/armada_thermal.c
··· 357 357 int ret; 358 358 359 359 /* Valid check */ 360 - if (armada_is_valid(priv)) { 360 + if (!armada_is_valid(priv)) { 361 361 dev_err(priv->dev, 362 362 "Temperature sensor reading not valid\n"); 363 363 return -EIO; ··· 395 395 return ret; 396 396 } 397 397 398 - static struct thermal_zone_of_device_ops of_ops = { 398 + static const struct thermal_zone_of_device_ops of_ops = { 399 399 .get_temp = armada_get_temp, 400 400 }; 401 401 ··· 526 526 527 527 /* First memory region points towards the status register */ 528 528 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 529 - if (!res) 530 - return -EIO; 531 - 532 - /* 533 - * Edit the resource start address and length to map over all the 534 - * registers, instead of pointing at them one by one. 535 - */ 536 - res->start -= data->syscon_status_off; 537 - res->end = res->start + max(data->syscon_status_off, 538 - max(data->syscon_control0_off, 539 - data->syscon_control1_off)) + 540 - sizeof(unsigned int) - 1; 541 - 542 529 base = devm_ioremap_resource(&pdev->dev, res); 543 530 if (IS_ERR(base)) 544 531 return PTR_ERR(base); 532 + 533 + /* 534 + * Fix up from the old individual DT register specification to 535 + * cover all the registers. We do this by adjusting the ioremap() 536 + * result, which should be fine as ioremap() deals with pages. 537 + * However, validate that we do not cross a page boundary while 538 + * making this adjustment. 539 + */ 540 + if (((unsigned long)base & ~PAGE_MASK) < data->syscon_status_off) 541 + return -EINVAL; 542 + base -= data->syscon_status_off; 545 543 546 544 priv->syscon = devm_regmap_init_mmio(&pdev->dev, base, 547 545 &armada_thermal_regmap_config);
+1 -10
drivers/thermal/broadcom/bcm2835_thermal.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 1 2 /* 2 3 * Driver for Broadcom BCM2835 SoC temperature sensor 3 4 * 4 5 * Copyright (C) 2016 Martin Sperl 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; either version 2 of the License, or 9 - * (at your option) any later version. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 6 */ 16 7 17 8 #include <linux/clk.h>
+1 -1
drivers/thermal/broadcom/brcmstb_thermal.c
··· 299 299 return 0; 300 300 } 301 301 302 - static struct thermal_zone_of_device_ops of_ops = { 302 + static const struct thermal_zone_of_device_ops of_ops = { 303 303 .get_temp = brcmstb_get_temp, 304 304 .set_trips = brcmstb_set_trips, 305 305 };