* NULL is passed, a large enough buffer will be allocated,
* and the caller must free it.
* @param count_ptr output variable for the length of byte string
- * @return pointer to output buffer
+ * Return: pointer to output buffer
*/
void *parse_byte_string(char *bytes, u8 *data, size_t *count_ptr)
{
for (i = 0; i < length; i += 2) {
byte[0] = bytes[i];
byte[1] = bytes[i + 1];
- data[i / 2] = (u8)simple_strtoul(byte, NULL, 16);
+ data[i / 2] = (u8)hextoul(byte, NULL);
}
if (count_ptr)
* report_return_code() - Report any error and return failure or success
*
* @param return_code TPM command return code
- * @return value of enum command_ret_t
+ * Return: value of enum command_ret_t
*/
int report_return_code(int return_code)
{
* Return number of values defined by a type string.
*
* @param type_str type string
- * @return number of values of type string
+ * Return: number of values of type string
*/
int type_string_get_num_values(const char *type_str)
{
* Return total size of values defined by a type string.
*
* @param type_str type string
- * @return total size of values of type string, or 0 if type string
+ * Return: total size of values of type string, or 0 if type string
* contains illegal type character.
*/
size_t type_string_get_space_size(const char *type_str)
*
* @param type_str type string
* @param count pointer for storing size of buffer
- * @return pointer to buffer or NULL on error
+ * Return: pointer to buffer or NULL on error
*/
void *type_string_alloc(const char *type_str, u32 *count)
{
* @param type_str type string
* @param values text strings of values to be packed
* @param data output buffer of values
- * @return 0 on success, non-0 on error
+ * Return: 0 on success, non-0 on error
*/
int type_string_pack(const char *type_str, char * const values[],
u8 *data)
* @param type_str type string
* @param data input buffer of values
* @param vars names of environment variables
- * @return 0 on success, non-0 on error
+ * Return: 0 on success, non-0 on error
*/
int type_string_write_vars(const char *type_str, u8 *data,
char * const vars[])
return 0;
}
-int do_tpm_device(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_tpm_device(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
unsigned long num;
int rc;
if (argc == 2) {
- num = simple_strtoul(argv[1], NULL, 10);
+ num = dectoul(argv[1], NULL);
rc = tpm_set_device(num);
if (rc)
return rc;
}
-int do_tpm_info(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+int do_tpm_info(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct udevice *dev;
char buf[80];
return 0;
}
-int do_tpm_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_tpm_init(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
struct udevice *dev;
int rc;
return report_return_code(tpm_init(dev));
}
-int do_tpm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_tpm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
- cmd_tbl_t *tpm_commands, *cmd;
+ struct cmd_tbl *tpm_commands, *cmd;
struct tpm_chip_priv *priv;
struct udevice *dev;
unsigned int size;