Re: [PATCH v2 18/29] nios2: Device tree support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 15 July 2014 16:45:45 Ley Foon Tan wrote:
> +static struct of_device_id altera_of_bus_ids[] __initdata = {
> +       { .compatible = "simple-bus", },
> +       { .compatible = "altr,avalon", },
> +       {}
> +};

Can you change the avalon bus nodes to be compatible to with "simple-bus"
as well, so you can use the default id list?

> +static int __init nios2_soc_device_init(void)
> +{
> +       struct soc_device *soc_dev;
> +       struct soc_device_attribute *soc_dev_attr;
> +       const char *machine;
> +
> +       soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
> +       if (soc_dev_attr) {
> +               machine = of_flat_dt_get_machine_name();
> +               if (machine)
> +                       soc_dev_attr->machine = kasprintf(GFP_KERNEL, "%s",
> +                                               machine);
> +
> +               soc_dev_attr->family = "Nios II";
> +
> +               soc_dev = soc_device_register(soc_dev_attr);
> +               if (IS_ERR(soc_dev)) {
> +                       kfree(soc_dev_attr->machine);
> +                       kfree(soc_dev_attr);
> +               }
> +       }
> +
> +       return of_platform_bus_probe(NULL, altera_of_bus_ids, NULL);
> +}
> +
> +device_initcall(nios2_soc_device_init);
> 
I think you should use of_platform_populate instead of of_platform_bus_probe
here.

	ARnd
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux