Merge patch series "Add non-coherent DMA support for AX45MP"
[linux-2.6-microblaze.git] / drivers / power / supply / power_supply_core.c
index 3791aec..4aa466c 100644 (file)
@@ -1305,8 +1305,12 @@ static int psy_register_thermal(struct power_supply *psy)
 
        /* Register battery zone device psy reports temperature */
        if (psy_has_property(psy->desc, POWER_SUPPLY_PROP_TEMP)) {
+               /* Prefer our hwmon device and avoid duplicates */
+               struct thermal_zone_params tzp = {
+                       .no_hwmon = IS_ENABLED(CONFIG_POWER_SUPPLY_HWMON)
+               };
                psy->tzd = thermal_zone_device_register(psy->desc->name,
-                               0, 0, psy, &psy_tzd_ops, NULL, 0, 0);
+                               0, 0, psy, &psy_tzd_ops, &tzp, 0, 0);
                if (IS_ERR(psy->tzd))
                        return PTR_ERR(psy->tzd);
                ret = thermal_zone_device_enable(psy->tzd);