/* Complete gameport port registration. Driver core will attempt to find appropriate driver for the port.  */
static void gameport_add_port(struct gameport *gameport)
/* Complete gameport port registration. Driver core will attempt to find appropriate driver for the port.  */
static void gameport_add_port(struct gameport *gameport)
{
	int error;
	if (gameport->parent)
		gameport->parent->child = gameport;
	gameport->speed = gameport_measure_speed(gameport);
	list_add_tail(&gameport->node, &gameport_list);
	if (gameport->io)
		printk(KERN_INFO "gameport: %s is %s, io %#x, speed %dkHz\n",
			gameport->name, gameport->phys, gameport->io, gameport->speed);
	else
		printk(KERN_INFO "gameport: %s is %s, speed %dkHz\n",
			gameport->name, gameport->phys, gameport->speed);
	error = device_add(&gameport->dev);
	if (error)
		printk(KERN_ERR
			"gameport: device_add() failed for %s (%s), error: %d\n",
			gameport->phys, gameport->name, error);
	else
		gameport->registered = 1;
}