struct *xxx_class;
EXPORT_SYMBOL(xxx_class);

static void __exit cleanup_xxx(void)
{
  ...
  class_destroy(xxx_class);
}

static int __init init_xxx(void)
{
  ...
  xxx_class = class_create(THIS_MODULE, "xxx");
  if (IS_ERR(sound_class))
    return PTR_ERR(sound_class);

  return 0;
}