[RFC] w1: regression, remove need for ida and use PLATFORM_DEVID_AUTO

Petr Cvek petr.cvek at tul.cz
Wed Feb 1 17:05:50 PST 2017


Patch 
	w1: remove need for ida and use PLATFORM_DEVID_AUTO
	098f9fb0c962eb2fdba5f9d34f4cf7a938237184 

causes a regression in the w1_ds2760 driver. Initialization creates a name "ds2760-battery.0.auto". It seems that name of that size will cause checking code in __thermal_cooling_device_register() from thermal_core.c to fail as it checks for names shorter than 20 chars:

	if (type && strlen(type) >= THERMAL_NAME_LENGTH)
		return ERR_PTR(-EINVAL);

A second problem seems to be with magician_supplicants list as "ds2760-battery.0" does not match in a test power_supply_am_i_supplied() in ds2760_battery_update_status() from drivers/power/supply/ds2760_battery.c . This causes status flag to be forever in POWER_SUPPLY_STATUS_DISCHARGING state.

Functionality returned after I hotfix changed (drivers/w1/slaves/w1_ds2760.c)

	pdev = platform_device_alloc("ds2760-battery", PLATFORM_DEVID_AUTO);

to

	pdev = platform_device_alloc("ds2760-battery", 0);

Which solution do you advise. Shortening the name let's say just to "ds2760" (with changes to arch files, w1 files and supply files), increasing THERMAL_NAME_LENGTH to let's say 32 (I don't know if this doesn't break something other) or just reverting to the old behavior?

Best regards,
Petr



More information about the linux-arm-kernel mailing list