Ejemplo n.º 1
0
int ata_port_detect(struct ata_port *port)
{
	int ret;

	if (port->initialized) {
		dev_dbg(&port->class_dev, "already initialized\n");
		return 0;
	}

	ret = ata_port_init(port);
	if (ret)
		return ret;

	port->initialized = 1;

	return 0;
}
Ejemplo n.º 2
0
static int ata_set_probe(struct device_d *class_dev, struct param_d *param,
				const char *val)
{
	struct ata_port *port = container_of(class_dev, struct ata_port, class_dev);
	int ret, probe;

	if (port->initialized) {
		dev_info(class_dev, "already initialized\n");
		return 0;
	}

	probe = !!simple_strtoul(val, NULL, 0);
	if (!probe)
		return 0;

	ret = ata_port_init(port);
	if (ret)
		return ret;

	port->initialized = 1;

	return dev_param_set_generic(class_dev, param, "1");
}