[RFC PATCH 09/14] ARM: ARM flash driver DT port

Grant Likely grant.likely at secretlab.ca
Thu Aug 19 07:22:56 EST 2010


On Wed, Aug 18, 2010 at 12:59 PM, Lorenzo Pieralisi
<lorenzo.pieralisi at arm.com> wrote:
> When OF is enabled drivers should initialize the driver match table
> to allow the kernel to find and recognise drivers suitable for
> devices. The initialization is carried out through a static inline
> function at driver init time.
>
> This patch adds a match table and relative init code to support
> device tree probing methodology for the ARM flash driver.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>
> ---
>  drivers/mtd/maps/integrator-flash.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
> index 2aac41b..aa9a556 100644
> --- a/drivers/mtd/maps/integrator-flash.c
> +++ b/drivers/mtd/maps/integrator-flash.c
> @@ -291,6 +291,11 @@ static int armflash_remove(struct platform_device *dev)
>        return 0;
>  }
>
> +static struct of_device_id armflash_matches[] = {
> +       { .compatible = "arm,arm-flash"},

(Assuming I'm reading the integrator-flash driver correctly...) When
using the device tree, the entire flash map should be encoded in the
tree, and this mapping driver is no longer needed.  See
mtd/maps/physmap_of.c.

> +       {},
> +};
> +
>  static struct platform_driver armflash_driver = {
>        .probe          = armflash_probe,
>        .remove         = armflash_remove,
> @@ -302,6 +307,7 @@ static struct platform_driver armflash_driver = {
>
>  static int __init armflash_init(void)
>  {
> +       platform_init_match(&armflash_driver, armflash_matches);
>        return platform_driver_register(&armflash_driver);
>  }
>
> --
> 1.6.3.3
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.


More information about the devicetree-discuss mailing list