static struct device_driver vesafb_driver = {
  .name = "vesafb",
  .bus = &platform_bus_type,
  .probe = vesafb_probe,
};

static struct platform_device vesafb_device = {
  .name = "vesafb",
};

static int __init vesafb_init(void)
{
  int ret;
  char *option = NULL;

  ...
  ret = driver_register(&vesafb_driver);

  if (!ret) {
    ret = platform_device_register(&vesafb_device);
    if (ret)
      driver_unregister(&vesafb_driver);
    }
  return ret;
}