Lines Matching refs:entry
313 static int applesmc_read_entry(const struct applesmc_entry *entry, in applesmc_read_entry() argument
318 if (entry->len != len) in applesmc_read_entry()
321 ret = read_smc(APPLESMC_READ_CMD, entry->key, buf, len); in applesmc_read_entry()
327 static int applesmc_write_entry(const struct applesmc_entry *entry, in applesmc_write_entry() argument
332 if (entry->len != len) in applesmc_write_entry()
335 ret = write_smc(APPLESMC_WRITE_CMD, entry->key, buf, len); in applesmc_write_entry()
378 const struct applesmc_entry *entry; in applesmc_get_lower_bound() local
382 entry = applesmc_get_entry_by_index(middle); in applesmc_get_lower_bound()
383 if (IS_ERR(entry)) { in applesmc_get_lower_bound()
385 return PTR_ERR(entry); in applesmc_get_lower_bound()
387 if (strcmp(entry->key, key) < 0) in applesmc_get_lower_bound()
400 const struct applesmc_entry *entry; in applesmc_get_upper_bound() local
404 entry = applesmc_get_entry_by_index(middle); in applesmc_get_upper_bound()
405 if (IS_ERR(entry)) { in applesmc_get_upper_bound()
407 return PTR_ERR(entry); in applesmc_get_upper_bound()
409 if (strcmp(key, entry->key) < 0) in applesmc_get_upper_bound()
438 const struct applesmc_entry *entry; in applesmc_read_key() local
440 entry = applesmc_get_entry_by_key(key); in applesmc_read_key()
441 if (IS_ERR(entry)) in applesmc_read_key()
442 return PTR_ERR(entry); in applesmc_read_key()
444 return applesmc_read_entry(entry, buffer, len); in applesmc_read_key()
449 const struct applesmc_entry *entry; in applesmc_write_key() local
451 entry = applesmc_get_entry_by_key(key); in applesmc_write_key()
452 if (IS_ERR(entry)) in applesmc_write_key()
453 return PTR_ERR(entry); in applesmc_write_key()
455 return applesmc_write_entry(entry, buffer, len); in applesmc_write_key()
460 const struct applesmc_entry *entry; in applesmc_has_key() local
462 entry = applesmc_get_entry_by_key(key); in applesmc_has_key()
463 if (IS_ERR(entry) && PTR_ERR(entry) != -EINVAL) in applesmc_has_key()
464 return PTR_ERR(entry); in applesmc_has_key()
466 *value = !IS_ERR(entry); in applesmc_has_key()
512 const struct applesmc_entry *entry; in applesmc_init_index() local
523 entry = applesmc_get_entry_by_index(i); in applesmc_init_index()
524 if (IS_ERR(entry)) in applesmc_init_index()
526 if (strcmp(entry->type, TEMP_SENSOR_TYPE)) in applesmc_init_index()
528 s->index[s->index_count++] = entry->key; in applesmc_init_index()
744 const struct applesmc_entry *entry; in applesmc_light_show() local
751 entry = applesmc_get_entry_by_key(LIGHT_SENSOR_LEFT_KEY); in applesmc_light_show()
752 if (IS_ERR(entry)) in applesmc_light_show()
753 return PTR_ERR(entry); in applesmc_light_show()
754 if (entry->len > 10) in applesmc_light_show()
756 data_length = entry->len; in applesmc_light_show()
969 const struct applesmc_entry *entry; in applesmc_key_at_index_read_show() local
972 entry = applesmc_get_entry_by_index(key_at_index); in applesmc_key_at_index_read_show()
973 if (IS_ERR(entry)) in applesmc_key_at_index_read_show()
974 return PTR_ERR(entry); in applesmc_key_at_index_read_show()
975 ret = applesmc_read_entry(entry, sysfsbuf, entry->len); in applesmc_key_at_index_read_show()
979 return entry->len; in applesmc_key_at_index_read_show()
985 const struct applesmc_entry *entry; in applesmc_key_at_index_data_length_show() local
987 entry = applesmc_get_entry_by_index(key_at_index); in applesmc_key_at_index_data_length_show()
988 if (IS_ERR(entry)) in applesmc_key_at_index_data_length_show()
989 return PTR_ERR(entry); in applesmc_key_at_index_data_length_show()
991 return snprintf(sysfsbuf, PAGE_SIZE, "%d\n", entry->len); in applesmc_key_at_index_data_length_show()
997 const struct applesmc_entry *entry; in applesmc_key_at_index_type_show() local
999 entry = applesmc_get_entry_by_index(key_at_index); in applesmc_key_at_index_type_show()
1000 if (IS_ERR(entry)) in applesmc_key_at_index_type_show()
1001 return PTR_ERR(entry); in applesmc_key_at_index_type_show()
1003 return snprintf(sysfsbuf, PAGE_SIZE, "%s\n", entry->type); in applesmc_key_at_index_type_show()
1009 const struct applesmc_entry *entry; in applesmc_key_at_index_name_show() local
1011 entry = applesmc_get_entry_by_index(key_at_index); in applesmc_key_at_index_name_show()
1012 if (IS_ERR(entry)) in applesmc_key_at_index_name_show()
1013 return PTR_ERR(entry); in applesmc_key_at_index_name_show()
1015 return snprintf(sysfsbuf, PAGE_SIZE, "%s\n", entry->key); in applesmc_key_at_index_name_show()