Lines Matching refs:new_custom
389 struct ltc2983_custom_sensor *new_custom; in __ltc2983_custom_sensor_new() local
409 new_custom = devm_kzalloc(dev, sizeof(*new_custom), GFP_KERNEL); in __ltc2983_custom_sensor_new()
410 if (!new_custom) in __ltc2983_custom_sensor_new()
413 new_custom->size = n_entries * n_size; in __ltc2983_custom_sensor_new()
415 if (is_steinhart && new_custom->size != LTC2983_CUSTOM_STEINHART_SIZE) { in __ltc2983_custom_sensor_new()
416 dev_err(dev, "Steinhart sensors size(%zu) must be %u\n", new_custom->size, in __ltc2983_custom_sensor_new()
421 if (st->custom_table_size + new_custom->size > in __ltc2983_custom_sensor_new()
425 st->custom_table_size, new_custom->size); in __ltc2983_custom_sensor_new()
431 new_custom->table = devm_kcalloc(dev, n_entries, sizeof(u32), GFP_KERNEL); in __ltc2983_custom_sensor_new()
433 new_custom->table = devm_kcalloc(dev, n_entries, sizeof(u64), GFP_KERNEL); in __ltc2983_custom_sensor_new()
434 if (!new_custom->table) in __ltc2983_custom_sensor_new()
445 ret = fwnode_property_read_u32_array(fn, propname, new_custom->table, n_entries); in __ltc2983_custom_sensor_new()
449 cpu_to_be32_array(new_custom->table, new_custom->table, n_entries); in __ltc2983_custom_sensor_new()
451 ret = fwnode_property_read_u64_array(fn, propname, new_custom->table, n_entries); in __ltc2983_custom_sensor_new()
456 u64 temp = ((u64 *)new_custom->table)[index]; in __ltc2983_custom_sensor_new()
465 put_unaligned_be24(temp, new_custom->table + index * 3); in __ltc2983_custom_sensor_new()
469 new_custom->is_steinhart = is_steinhart; in __ltc2983_custom_sensor_new()
482 new_custom->offset = st->custom_table_size / in __ltc2983_custom_sensor_new()
484 st->custom_table_size += new_custom->size; in __ltc2983_custom_sensor_new()
487 new_custom->offset = -1; in __ltc2983_custom_sensor_new()
490 return new_custom; in __ltc2983_custom_sensor_new()