Index: uspace/drv/block/ahci/ahci.c
===================================================================
--- uspace/drv/block/ahci/ahci.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/block/ahci/ahci.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -229,5 +229,5 @@
 {
 	sata_dev_t *sata = fun_sata_dev(fun);
-	
+
 	uintptr_t phys;
 	void *ibuf = AS_AREA_ANY;
@@ -238,21 +238,21 @@
 		return rc;
 	}
-	
+
 	memset(buf, 0, sata->block_size);
-	
+
 	fibril_mutex_lock(&sata->lock);
-	
+
 	for (size_t cur = 0; cur < count; cur++) {
 		rc = ahci_rb_fpdma(sata, phys, blocknum + cur);
 		if (rc != EOK)
 			break;
-		
+
 		memcpy((void *) (((uint8_t *) buf) + (sata->block_size * cur)),
 		    ibuf, sata->block_size);
 	}
-	
+
 	fibril_mutex_unlock(&sata->lock);
 	dmamem_unmap_anonymous(ibuf);
-	
+
 	return rc;
 }
@@ -272,5 +272,5 @@
 {
 	sata_dev_t *sata = fun_sata_dev(fun);
-	
+
 	uintptr_t phys;
 	void *ibuf = AS_AREA_ANY;
@@ -281,7 +281,7 @@
 		return rc;
 	}
-	
+
 	fibril_mutex_lock(&sata->lock);
-	
+
 	for (size_t cur = 0; cur < count; cur++) {
 		memcpy(ibuf, (void *) (((uint8_t *) buf) + (sata->block_size * cur)),
@@ -291,8 +291,8 @@
 			break;
 	}
-	
+
 	fibril_mutex_unlock(&sata->lock);
 	dmamem_unmap_anonymous(ibuf);
-	
+
 	return rc;
 }
@@ -312,16 +312,16 @@
 {
 	fibril_mutex_lock(&sata->event_lock);
-	
+
 	sata->event_pxis = 0;
 	while (sata->event_pxis == 0)
 		fibril_condvar_wait(&sata->event_condvar, &sata->event_lock);
-	
+
 	ahci_port_is_t pxis = sata->event_pxis;
-	
+
 	if (ahci_port_is_permanent_error(pxis))
 		sata->is_invalid_device = true;
-	
+
 	fibril_mutex_unlock(&sata->event_lock);
-	
+
 	return pxis;
 }
@@ -337,5 +337,5 @@
 	volatile sata_std_command_frame_t *cmd =
 	    (sata_std_command_frame_t *) sata->cmd_table;
-	
+
 	cmd->fis_type = SATA_CMD_FIS_TYPE;
 	cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR;
@@ -350,8 +350,8 @@
 	cmd->control = 0;
 	cmd->reserved2 = 0;
-	
+
 	volatile ahci_cmd_prdt_t *prdt =
 	    (ahci_cmd_prdt_t *) (&sata->cmd_table[0x20]);
-	
+
 	prdt->data_address_low = LO(phys);
 	prdt->data_address_upper = HI(phys);
@@ -360,5 +360,5 @@
 	prdt->reserved2 = 0;
 	prdt->ioc = 0;
-	
+
 	sata->cmd_header->prdtl = 1;
 	sata->cmd_header->flags =
@@ -366,5 +366,5 @@
 	    AHCI_CMDHDR_FLAGS_2DWCMD;
 	sata->cmd_header->bytesprocessed = 0;
-	
+
 	/* Run command. */
 	sata->port->pxsact |= 1;
@@ -382,5 +382,5 @@
 	volatile sata_std_command_frame_t *cmd =
 	    (sata_std_command_frame_t *) sata->cmd_table;
-	
+
 	cmd->fis_type = SATA_CMD_FIS_TYPE;
 	cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR;
@@ -395,8 +395,8 @@
 	cmd->control = 0;
 	cmd->reserved2 = 0;
-	
+
 	volatile ahci_cmd_prdt_t *prdt =
 	    (ahci_cmd_prdt_t *) (&sata->cmd_table[0x20]);
-	
+
 	prdt->data_address_low = LO(phys);
 	prdt->data_address_upper = HI(phys);
@@ -405,5 +405,5 @@
 	prdt->reserved2 = 0;
 	prdt->ioc = 0;
-	
+
 	sata->cmd_header->prdtl = 1;
 	sata->cmd_header->flags =
@@ -411,5 +411,5 @@
 	    AHCI_CMDHDR_FLAGS_2DWCMD;
 	sata->cmd_header->bytesprocessed = 0;
-	
+
 	/* Run command. */
 	sata->port->pxsact |= 1;
@@ -431,5 +431,5 @@
 		return EINTR;
 	}
-	
+
 	uintptr_t phys;
 	sata_identify_data_t *idata = AS_AREA_ANY;
@@ -441,12 +441,12 @@
 		return rc;
 	}
-	
+
 	memset(idata, 0, SATA_IDENTIFY_DEVICE_BUFFER_LENGTH);
-	
+
 	fibril_mutex_lock(&sata->lock);
-	
+
 	ahci_identify_device_cmd(sata, phys);
 	ahci_port_is_t pxis = ahci_wait_event(sata);
-	
+
 	if (sata->is_invalid_device) {
 		ddf_msg(LVL_ERROR,
@@ -454,9 +454,9 @@
 		goto error;
 	}
-	
+
 	if (ahci_port_is_tfes(pxis)) {
 		ahci_identify_packet_device_cmd(sata, phys);
 		pxis = ahci_wait_event(sata);
-		
+
 		if ((sata->is_invalid_device) || (ahci_port_is_error(pxis))) {
 			ddf_msg(LVL_ERROR,
@@ -464,10 +464,10 @@
 			goto error;
 		}
-		
+
 		sata->is_packet_device = true;
 	}
-	
+
 	ahci_get_model_name(idata->model_name, sata->model);
-	
+
 	/*
 	 * Due to QEMU limitation (as of 2012-06-22),
@@ -478,5 +478,5 @@
 		goto error;
 	}
-	
+
 	uint16_t logsec = idata->physical_logic_sector_size;
 	if ((logsec & 0xc000) == 0x4000) {
@@ -489,5 +489,5 @@
 			goto error;
 		}
-		
+
 		if ((logsec & 0x0200) && ((logsec & 0x000f) != 0)) {
 			/* Physical sectors per logical sector is greather than 1 */
@@ -498,5 +498,5 @@
 		}
 	}
-	
+
 	if (sata->is_packet_device) {
 		/*
@@ -509,5 +509,5 @@
 	} else {
 		sata->block_size = SATA_DEFAULT_SECTOR_SIZE;
-		
+
 		if ((idata->caps & sata_rd_cap_lba) == 0) {
 			ddf_msg(LVL_ERROR, "%s: LBA for NCQ must be supported",
@@ -525,5 +525,5 @@
 		}
 	}
-	
+
 	uint8_t udma_mask = idata->udma & 0x007f;
 	sata->highest_udma_mode = (uint8_t) -1;
@@ -539,14 +539,14 @@
 		}
 	}
-	
+
 	fibril_mutex_unlock(&sata->lock);
 	dmamem_unmap_anonymous(idata);
-	
+
 	return EOK;
-	
+
 error:
 	fibril_mutex_unlock(&sata->lock);
 	dmamem_unmap_anonymous(idata);
-	
+
 	return EINTR;
 }
@@ -563,5 +563,5 @@
 	volatile sata_std_command_frame_t *cmd =
 	    (sata_std_command_frame_t *) sata->cmd_table;
-	
+
 	cmd->fis_type = SATA_CMD_FIS_TYPE;
 	cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR;
@@ -576,8 +576,8 @@
 	cmd->control = 0;
 	cmd->reserved2 = 0;
-	
+
 	volatile ahci_cmd_prdt_t *prdt =
 	    (ahci_cmd_prdt_t *) (&sata->cmd_table[0x20]);
-	
+
 	prdt->data_address_low = LO(phys);
 	prdt->data_address_upper = HI(phys);
@@ -586,5 +586,5 @@
 	prdt->reserved2 = 0;
 	prdt->ioc = 0;
-	
+
 	sata->cmd_header->prdtl = 1;
 	sata->cmd_header->flags =
@@ -592,5 +592,5 @@
 	    AHCI_CMDHDR_FLAGS_2DWCMD;
 	sata->cmd_header->bytesprocessed = 0;
-	
+
 	/* Run command. */
 	sata->port->pxsact |= 1;
@@ -613,5 +613,5 @@
 		return EINTR;
 	}
-	
+
 	if (sata->highest_udma_mode == (uint8_t) -1) {
 		ddf_msg(LVL_ERROR,
@@ -619,5 +619,5 @@
 		return EINTR;
 	}
-	
+
 	if (sata->highest_udma_mode > 6) {
 		ddf_msg(LVL_ERROR,
@@ -625,5 +625,5 @@
 		return EINTR;
 	}
-	
+
 	uintptr_t phys;
 	sata_identify_data_t *idata = AS_AREA_ANY;
@@ -635,13 +635,13 @@
 		return rc;
 	}
-	
+
 	memset(idata, 0, SATA_SET_FEATURE_BUFFER_LENGTH);
-	
+
 	fibril_mutex_lock(&sata->lock);
-	
+
 	uint8_t mode = 0x40 | (sata->highest_udma_mode & 0x07);
 	ahci_set_mode_cmd(sata, phys, mode);
 	ahci_port_is_t pxis = ahci_wait_event(sata);
-	
+
 	if (sata->is_invalid_device) {
 		ddf_msg(LVL_ERROR,
@@ -650,5 +650,5 @@
 		goto error;
 	}
-	
+
 	if (ahci_port_is_error(pxis)) {
 		ddf_msg(LVL_ERROR,
@@ -656,14 +656,14 @@
 		goto error;
 	}
-	
+
 	fibril_mutex_unlock(&sata->lock);
 	dmamem_unmap_anonymous(idata);
-	
+
 	return EOK;
-	
+
 error:
 	fibril_mutex_unlock(&sata->lock);
 	dmamem_unmap_anonymous(idata);
-	
+
 	return EINTR;
 }
@@ -681,5 +681,5 @@
 	volatile sata_ncq_command_frame_t *cmd =
 	    (sata_ncq_command_frame_t *) sata->cmd_table;
-	
+
 	cmd->fis_type = SATA_CMD_FIS_TYPE;
 	cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR;
@@ -687,5 +687,5 @@
 	cmd->tag = 0;
 	cmd->control = 0;
-	
+
 	cmd->reserved1 = 0;
 	cmd->reserved2 = 0;
@@ -694,8 +694,8 @@
 	cmd->reserved5 = 0;
 	cmd->reserved6 = 0;
-	
+
 	cmd->sector_count_low = 1;
 	cmd->sector_count_high = 0;
-	
+
 	cmd->lba0 = blocknum & 0xff;
 	cmd->lba1 = (blocknum >> 8) & 0xff;
@@ -704,8 +704,8 @@
 	cmd->lba4 = (blocknum >> 32) & 0xff;
 	cmd->lba5 = (blocknum >> 40) & 0xff;
-	
+
 	volatile ahci_cmd_prdt_t *prdt =
 	    (ahci_cmd_prdt_t *) (&sata->cmd_table[0x20]);
-	
+
 	prdt->data_address_low = LO(phys);
 	prdt->data_address_upper = HI(phys);
@@ -714,5 +714,5 @@
 	prdt->reserved2 = 0;
 	prdt->ioc = 0;
-	
+
 	sata->cmd_header->prdtl = 1;
 	sata->cmd_header->flags =
@@ -720,5 +720,5 @@
 	    AHCI_CMDHDR_FLAGS_5DWCMD;
 	sata->cmd_header->bytesprocessed = 0;
-	
+
 	sata->port->pxsact |= 1;
 	sata->port->pxci |= 1;
@@ -741,8 +741,8 @@
 		return EINTR;
 	}
-	
+
 	ahci_rb_fpdma_cmd(sata, phys, blocknum);
 	ahci_port_is_t pxis = ahci_wait_event(sata);
-	
+
 	if ((sata->is_invalid_device) || (ahci_port_is_error(pxis))) {
 		ddf_msg(LVL_ERROR,
@@ -750,5 +750,5 @@
 		return EINTR;
 	}
-	
+
 	return EOK;
 }
@@ -768,5 +768,5 @@
 	volatile sata_ncq_command_frame_t *cmd =
 	    (sata_ncq_command_frame_t *) sata->cmd_table;
-	
+
 	cmd->fis_type = SATA_CMD_FIS_TYPE;
 	cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR;
@@ -774,5 +774,5 @@
 	cmd->tag = 0;
 	cmd->control = 0;
-	
+
 	cmd->reserved1 = 0;
 	cmd->reserved2 = 0;
@@ -781,8 +781,8 @@
 	cmd->reserved5 = 0;
 	cmd->reserved6 = 0;
-	
+
 	cmd->sector_count_low = 1;
 	cmd->sector_count_high = 0;
-	
+
 	cmd->lba0 = blocknum & 0xff;
 	cmd->lba1 = (blocknum >> 8) & 0xff;
@@ -791,8 +791,8 @@
 	cmd->lba4 = (blocknum >> 32) & 0xff;
 	cmd->lba5 = (blocknum >> 40) & 0xff;
-	
+
 	volatile ahci_cmd_prdt_t *prdt =
 	    (ahci_cmd_prdt_t *) (&sata->cmd_table[0x20]);
-	
+
 	prdt->data_address_low = LO(phys);
 	prdt->data_address_upper = HI(phys);
@@ -801,5 +801,5 @@
 	prdt->reserved2 = 0;
 	prdt->ioc = 0;
-	
+
 	sata->cmd_header->prdtl = 1;
 	sata->cmd_header->flags =
@@ -808,5 +808,5 @@
 	    AHCI_CMDHDR_FLAGS_5DWCMD;
 	sata->cmd_header->bytesprocessed = 0;
-	
+
 	sata->port->pxsact |= 1;
 	sata->port->pxci |= 1;
@@ -829,8 +829,8 @@
 		return EINTR;
 	}
-	
+
 	ahci_wb_fpdma_cmd(sata, phys, blocknum);
 	ahci_port_is_t pxis = ahci_wait_event(sata);
-	
+
 	if ((sata->is_invalid_device) || (ahci_port_is_error(pxis))) {
 		ddf_msg(LVL_ERROR,
@@ -838,5 +838,5 @@
 		return EINTR;
 	}
-	
+
 	return EOK;
 }
@@ -899,20 +899,20 @@
 	unsigned int port = IPC_GET_ARG1(*icall);
 	ahci_port_is_t pxis = IPC_GET_ARG2(*icall);
-	
+
 	if (port >= AHCI_MAX_PORTS)
 		return;
-	
+
 	sata_dev_t *sata = (sata_dev_t *) ahci->sata_devs[port];
 	if (sata == NULL)
 		return;
-	
+
 	/* Evaluate port event */
 	if ((ahci_port_is_end_of_operation(pxis)) ||
 	    (ahci_port_is_error(pxis))) {
 		fibril_mutex_lock(&sata->event_lock);
-		
+
 		sata->event_pxis = pxis;
 		fibril_condvar_signal(&sata->event_condvar);
-		
+
 		fibril_mutex_unlock(&sata->event_lock);
 	}
@@ -938,14 +938,14 @@
 	void *virt_table = AS_AREA_ANY;
 	ddf_fun_t *fun;
-	
+
 	fun = ddf_fun_create(ahci->dev, fun_exposed, NULL);
-	
+
 	sata_dev_t *sata = ddf_fun_data_alloc(fun, sizeof(sata_dev_t));
 	if (sata == NULL)
 		return NULL;
-	
+
 	sata->fun = fun;
 	sata->port = port;
-	
+
 	/* Allocate and init retfis structure. */
 	errno_t rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
@@ -953,9 +953,9 @@
 	if (rc != EOK)
 		goto error_retfis;
-	
+
 	memset(virt_fb, 0, size);
 	sata->port->pxfbu = HI(phys);
 	sata->port->pxfb = LO(phys);
-	
+
 	/* Allocate and init command header structure. */
 	rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
@@ -963,10 +963,10 @@
 	if (rc != EOK)
 		goto error_cmd;
-	
+
 	memset(virt_cmd, 0, size);
 	sata->port->pxclbu = HI(phys);
 	sata->port->pxclb = LO(phys);
 	sata->cmd_header = (ahci_cmdhdr_t *) virt_cmd;
-	
+
 	/* Allocate and init command table structure. */
 	rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
@@ -974,12 +974,12 @@
 	if (rc != EOK)
 		goto error_table;
-	
+
 	memset(virt_table, 0, size);
 	sata->cmd_header->cmdtableu = HI(phys);
 	sata->cmd_header->cmdtable = LO(phys);
 	sata->cmd_table = (uint32_t*) virt_table;
-	
+
 	return sata;
-	
+
 error_table:
 	dmamem_unmap(virt_cmd, size);
@@ -999,30 +999,30 @@
 {
 	ahci_port_cmd_t pxcmd;
-	
+
 	pxcmd.u32 = sata->port->pxcmd;
-	
+
 	/* Frame receiver disabled. */
 	pxcmd.fre = 0;
-	
+
 	/* Disable process the command list. */
 	pxcmd.st = 0;
-	
+
 	sata->port->pxcmd = pxcmd.u32;
-	
+
 	/* Clear interrupt status. */
 	sata->port->pxis = 0xffffffff;
-	
+
 	/* Clear error status. */
 	sata->port->pxserr = 0xffffffff;
-	
+
 	/* Enable all interrupts. */
 	sata->port->pxie = 0xffffffff;
-	
+
 	/* Frame receiver enabled. */
 	pxcmd.fre = 1;
-	
+
 	/* Enable process the command list. */
 	pxcmd.st = 1;
-	
+
 	sata->port->pxcmd = pxcmd.u32;
 }
@@ -1043,37 +1043,37 @@
 	ddf_fun_t *fun = NULL;
 	errno_t rc;
-	
+
 	sata_dev_t *sata = ahci_sata_allocate(ahci, port);
 	if (sata == NULL)
 		return EINTR;
-	
+
 	/* Set pointers between SATA and AHCI structures. */
 	sata->ahci = ahci;
 	sata->port_num = port_num;
 	ahci->sata_devs[port_num] = sata;
-	
+
 	/* Initialize synchronization structures */
 	fibril_mutex_initialize(&sata->lock);
 	fibril_mutex_initialize(&sata->event_lock);
 	fibril_condvar_initialize(&sata->event_condvar);
-	
+
 	ahci_sata_hw_start(sata);
-	
+
 	/* Identify device. */
 	if (ahci_identify_device(sata) != EOK)
 		goto error;
-	
+
 	/* Set required UDMA mode */
 	if (ahci_set_highest_ultra_dma_mode(sata) != EOK)
 		goto error;
-	
+
 	/* Add device to the system */
 	char sata_dev_name[16];
 	snprintf(sata_dev_name, 16, "ahci_%u", sata_devices_count);
-	
+
 	fibril_mutex_lock(&sata_devices_count_lock);
 	sata_devices_count++;
 	fibril_mutex_unlock(&sata_devices_count_lock);
-	
+
 	rc= ddf_fun_set_name(sata->fun, sata_dev_name);
 	if (rc != EOK) {
@@ -1081,7 +1081,7 @@
 		goto error;
 	}
-	
+
 	ddf_fun_set_ops(fun, &ahci_ops);
-	
+
 	rc = ddf_fun_bind(fun);
 	if (rc != EOK) {
@@ -1089,12 +1089,12 @@
 		goto error;
 	}
-	
+
 	return EOK;
-	
+
 error:
 	sata->is_invalid_device = true;
 	if (fun != NULL)
 		ddf_fun_destroy(fun);
-	
+
 	return EINTR;
 }
@@ -1112,7 +1112,7 @@
 		if (!(ahci->memregs->ghc.pi & (1 << port_num)))
 			continue;
-		
+
 		volatile ahci_port_t *port = ahci->memregs->ports + port_num;
-		
+
 		/* Active devices only */
 		ahci_port_ssts_t pxssts;
@@ -1120,5 +1120,5 @@
 		if (pxssts.det != AHCI_PORT_SSTS_DET_ACTIVE)
 			continue;
-		
+
 		ahci_sata_create(ahci, dev, port, port_num);
 	}
@@ -1137,20 +1137,20 @@
 	if (!ahci)
 		return NULL;
-	
+
 	/* Connect to parent device */
 	ahci->parent_sess = ddf_dev_parent_sess_get(dev);
 	if (ahci->parent_sess == NULL)
 		return NULL;
-	
+
 	ahci->dev = dev;
-	
+
 	hw_res_list_parsed_t hw_res_parsed;
 	hw_res_list_parsed_init(&hw_res_parsed);
 	if (hw_res_get_list_parsed(ahci->parent_sess, &hw_res_parsed, 0) != EOK)
 		goto error_get_res_parsed;
-	
+
 	/* Map AHCI registers. */
 	ahci->memregs = AS_AREA_ANY;
-	
+
 	physmem_map(RNGABS(hw_res_parsed.mem_ranges.ranges[0]),
 	    AHCI_MEMREGS_PAGES_COUNT, AS_AREA_READ | AS_AREA_WRITE,
@@ -1158,12 +1158,12 @@
 	if (ahci->memregs == NULL)
 		goto error_map_registers;
-	
+
 	/* Register interrupt handler */
 	ahci_ranges[0].base = RNGABS(hw_res_parsed.mem_ranges.ranges[0]);
 	ahci_ranges[0].size = sizeof(ahci_memregs_t);
-	
+
 	for (unsigned int port = 0; port < AHCI_MAX_PORTS; port++) {
 		size_t base = port * 7;
-		
+
 		ahci_cmds[base].addr =
 		    ((uint32_t *) RNGABSPTR(hw_res_parsed.mem_ranges.ranges[0])) +
@@ -1171,5 +1171,5 @@
 		    AHCI_PORT_IS_REGISTER_OFFSET;
 		ahci_cmds[base + 2].addr = ahci_cmds[base].addr;
-		
+
 		ahci_cmds[base + 3].addr =
 		    ((uint32_t *) RNGABSPTR(hw_res_parsed.mem_ranges.ranges[0])) +
@@ -1177,5 +1177,5 @@
 		ahci_cmds[base + 4].addr = ahci_cmds[base + 3].addr;
 	}
-	
+
 	irq_code_t ct;
 	ct.cmdcount = sizeof(ahci_cmds) / sizeof(irq_cmd_t);
@@ -1183,5 +1183,5 @@
 	ct.rangecount = sizeof(ahci_ranges) / sizeof(irq_pio_range_t);
 	ct.ranges = ahci_ranges;
-	
+
 	int irq_cap;
 	errno_t rc = register_interrupt_handler(dev,
@@ -1191,5 +1191,5 @@
 		goto error_register_interrupt_handler;
 	}
-	
+
 	rc = hw_res_enable_interrupt(ahci->parent_sess,
 	    hw_res_parsed.irqs.irqs[0]);
@@ -1198,17 +1198,17 @@
 		goto error_enable_interrupt;
 	}
-	
+
 	hw_res_list_parsed_clean(&hw_res_parsed);
 	return ahci;
-	
+
 error_enable_interrupt:
 	unregister_interrupt_handler(dev, irq_cap);
-	
+
 error_register_interrupt_handler:
 	// FIXME: unmap physical memory
-	
+
 error_map_registers:
 	hw_res_list_parsed_clean(&hw_res_parsed);
-	
+
 error_get_res_parsed:
 	free(ahci);
@@ -1225,20 +1225,20 @@
 	/* Disable command completion coalescing feature */
 	ahci_ghc_ccc_ctl_t ccc;
-	
+
 	ccc.u32 = ahci->memregs->ghc.ccc_ctl;
 	ccc.en = 0;
 	ahci->memregs->ghc.ccc_ctl = ccc.u32;
-	
+
 	/* Set master latency timer. */
 	pci_config_space_write_8(ahci->parent_sess, AHCI_PCI_MLT, 32);
-	
+
 	/* Enable PCI interrupt and bus mastering */
 	ahci_pcireg_cmd_t cmd;
-	
+
 	pci_config_space_read_16(ahci->parent_sess, AHCI_PCI_CMD, &cmd.u16);
 	cmd.id = 0;
 	cmd.bme = 1;
 	pci_config_space_write_16(ahci->parent_sess, AHCI_PCI_CMD, cmd.u16);
-	
+
 	/* Enable AHCI and interrupt. */
 	ahci->memregs->ghc.ghc = AHCI_GHC_GHC_AE | AHCI_GHC_GHC_IE;
@@ -1260,13 +1260,13 @@
 	if (ahci == NULL)
 		goto error;
-	
+
 	/* Start AHCI hardware. */
 	ahci_ahci_hw_start(ahci);
-	
+
 	/* Create device structures for sata devices attached to AHCI. */
 	ahci_sata_devices_create(ahci, dev);
-	
+
 	return EOK;
-	
+
 error:
 	return EINTR;
@@ -1290,5 +1290,5 @@
 	uint8_t model[40];
 	memset(model, 0, 40);
-	
+
 	for (unsigned int i = 0; i < 20; i++) {
 		uint16_t w = src[i];
@@ -1296,9 +1296,9 @@
 		model[2 * i + 1] = w & 0x00ff;
 	}
-	
+
 	uint32_t len = 40;
 	while ((len > 0) && (model[len - 1] == 0x20))
 		len--;
-	
+
 	size_t pos = 0;
 	for (unsigned int i = 0; i < len; i++) {
@@ -1306,8 +1306,8 @@
 		if (c >= 0x80)
 			c = '?';
-		
+
 		chr_encode(c, dst, &pos, 40);
 	}
-	
+
 	dst[pos] = '\0';
 }
