Пример #1
0
static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	int rc = 0;

	if (argc >= 2) {
		int devnum = 0;

		if (argc == 3)
			devnum = (int)simple_strtoul(argv[2], NULL, 10);
		if (!strcmp(argv[1], "stop"))
			return sata_remove(devnum);

		if (!strcmp(argv[1], "init")) {
			if (sata_curr_device != -1) {
				rc = sata_remove(devnum);
				if (rc)
					return rc;
			}

			return sata_probe(devnum);
		}
	}

	/* If the user has not yet run `sata init`, do it now */
	if (sata_curr_device == -1) {
		rc = sata_probe(0);
		if (rc)
			return rc;
		sata_curr_device = 0;
	}

	return blk_common_cmd(argc, argv, IF_TYPE_SATA, &sata_curr_device);
}
Пример #2
0
static int splash_init_sata(void)
{
	return sata_probe(0);
}