int ret;
ret = part_get_info_by_name(dev_desc, name, info);
- if (ret) {
+ if (ret < 0) {
/* strlen("fastboot_partition_alias_") + 32(part_name) + 1 */
char env_alias_name[25 + 32 + 1];
char *aliased_part_name;
}
#endif
- if (part_get_info_by_name_or_alias(dev_desc, cmd, &info)) {
+ if (part_get_info_by_name_or_alias(dev_desc, cmd, &info) < 0) {
error("cannot find partition: '%s'\n", cmd);
fastboot_fail("cannot find partition");
return;
}
ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info);
- if (ret) {
+ if (ret < 0) {
error("cannot find partition: '%s'", cmd);
fastboot_fail("cannot find partition");
return;
* @param gpt_name - the specified table entry name
* @param info - returns the disk partition info
*
- * @return - '0' on match, '-1' on no match, otherwise error
+ * @return - the partition number on match (starting on 1), -1 on no match,
+ * otherwise error
*/
int part_get_info_by_name(struct blk_desc *dev_desc,
const char *name, disk_partition_t *info);