Subject: Re: [PATCH] When checking I8042 io port, use of_find_compatible_node() instead of of_find_node_by_type()

From: Segher Boessenkool <[email-masked]>
Date: Thu, 7 Jun 2007 15:05:51 +0200

> In check_legacy_ioport(), instead of using of_find_node_by_type() to
> find the 8042 node, use of_find_compatible_node() to find either the
> keyboard or mouse node.

Why?

>  	switch(base_port) {
>  	case I8042_DATA_REG:
> -		np = of_find_node_by_type(NULL, "8042");
> +		np = of_find_compatible_node(NULL, NULL, "pnpPNP,303");
> +		if (!np)
> +			np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03");
> +		if (np) {
> +			parent = of_get_parent(np);
> +			of_node_put(np);
> +			np = parent;
> +		}

This breaks other boards using 8042, if those exist --
if this code is board-specific, it is in the wrong file.

Segher