}
device->controller_priv = hw;
- hw->target = get_target_by_num(strtoul(args[1], NULL, 0));
+ hw->target = get_target(args[1]);
if (!hw->target) {
- LOG_ERROR("no target '%s' configured", args[1]);
+ LOG_ERROR("target '%s' not defined", args[1]);
free(hw);
return ERROR_NAND_DEVICE_INVALID;
}