[PATCH 2.6.21-rc1] ibmebus: Use of_device_uevent()

Sylvain Munaut tnt at 246tNt.com
Sat Feb 17 20:36:01 EST 2007


Hoang-Nam Nguyen wrote:
> This patch replaces ibmebus_uevent() by Sylvain's generic function.
>
>  struct bus_type ibmebus_bus_type = {
> -	.name = "ibmebus",
> -	.uevent = ibmebus_uevent,
> -	.match = ibmebus_bus_match,
> +	.name   = "ibmebus",
> +	.uevent = of_device_uevent,
> +	.match  = ibmebus_bus_match,
>  };
>  EXPORT_SYMBOL(ibmebus_bus_type);
>   
Doesn't that oops when called with the fake parent device ?

Either you do a wrapper that test for it (that's what I did when I
posted the patch).
Or, an even better approach is to add this

+	if (!ebus_dev->ofdev.node)
+		return -ENODEV;

inside the code of of_device_uevent itself.


	Sylvain






More information about the Linuxppc-dev mailing list