Re: [PATCH 2/2] Add driver for MAX17211/MAX17215 fuel gauge

From: ÐÐÑÐÐÐÐÐ ÐÐÐÐÑÐÐ ÐÐÐÑÐÐÑÐÐÐÑ
Date: Sun Apr 30 2017 - 13:32:55 EST


Hi!


[...]

+ * FixMe:
+ * Device without no_thermal = true not register (err -22)
+ * Len of platform device name "max17211-battery.X.auto"
+ * more than 20 chars limit in THERMAL_NAME_LENGTH from
+ * include/uapi/linux/thermal.h
+ */
IIRC we already had problems with small THERMAL_NAME_LENGTH before.
I suggest to add another patch, that increases THERMAL_NAME_LENGTH
(don't forget to Cc/To the thermal subsystem people).
May be rename "max17211-battery" to "max17211" and remove no_thermal = true? This case thermal zone will work again. In current (mainline) kernel all drivers "xxxxxx-battery" (like ds2780-battery or ds2760-battery) compiled, but not working (not registered). They can start working again without thermal zone by adding no_thermal = true or by remove "-battery" from platform device name. Alternative limit on THERMAL_NAME_LENGTH may be extended.
+ info->bat = power_supply_register(&pdev->dev, &info->bat_desc,
+ &psy_cfg);
+ if (IS_ERR(info->bat)) {
+ dev_err(info->dev, "failed to register battery\n");
+ return PTR_ERR(info->bat);
+ }
Please use devm_power_supply_register() and drop the remove
function.
Khm... probe/remove paired functions. I can use devm_power_supply_register in my code. But all other fuel gauge drivers use classic probe/remove pair. Which decision will be more correct?