[PATCH] generic check_legacy_ioport

Arnd Bergmann arnd at arndb.de
Wed Apr 18 07:22:22 EST 2007


On Tuesday 17 April 2007, Olaf Hering wrote:
> 
>  int check_legacy_ioport(unsigned long base_port)
>  {
> -       if (ppc_md.check_legacy_ioport == NULL)
> +       struct device_node *np;
> +       if (ppc_md.check_legacy_ioport == NULL) {
> +               np = of_find_node_by_type(NULL, "isa");
> +               if (np == NULL)
> +                       return -ENODEV;
> +               of_node_put(np);
>                 return 0;
> +       }
>         return ppc_md.check_legacy_ioport(base_port);
>  }

I could be wrong, but I think I've seen fake 'isa' bus nodes in the device tree
for machines that don't actually have isa. I probably saw this on very early
cell blades (not the ones currently shipping), but perhaps others have
made the same mistake.

How about simply defining a new common function like

int generic_deny_legacy_ioport(unsigned long base_port)
{
	return -EINVAL;
}

so that not every platform has to define their own but can either
set ppc_md.check_legacy_ioport to NULL, to generic_deny_legacy_ioport
or their own function if they do something fancy?

	Arnd <><



More information about the Linuxppc-dev mailing list