diff options
author | Chris Packham | 2017-05-25 11:49:12 +1200 |
---|---|---|
committer | Brian Norris | 2017-06-01 11:28:53 -0700 |
commit | 4db4d35ebda390b5287d758fdd51b26c24fbc26b (patch) | |
tree | e4039fb8f37619fb311eab40bdaec32e27ab7bca /drivers/mtd/devices/mchp23k256.c | |
parent | e3db1289e7432a882823a7effc474aff78868489 (diff) |
mtd: mchp23k256: Add OF device ID table
This allows registering of this device via a Device Tree.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/devices/mchp23k256.c')
-rw-r--r-- | drivers/mtd/devices/mchp23k256.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c index e237db9f1bdb..9d8306a15833 100644 --- a/drivers/mtd/devices/mchp23k256.c +++ b/drivers/mtd/devices/mchp23k256.c @@ -19,6 +19,7 @@ #include <linux/sizes.h> #include <linux/spi/flash.h> #include <linux/spi/spi.h> +#include <linux/of_device.h> struct mchp23k256_flash { struct spi_device *spi; @@ -166,9 +167,16 @@ static int mchp23k256_remove(struct spi_device *spi) return mtd_device_unregister(&flash->mtd); } +static const struct of_device_id mchp23k256_of_table[] = { + { .compatible = "microchip,mchp23k256" }, + {} +}; +MODULE_DEVICE_TABLE(of, mchp23k256_of_table); + static struct spi_driver mchp23k256_driver = { .driver = { .name = "mchp23k256", + .of_match_table = of_match_ptr(mchp23k256_of_table), }, .probe = mchp23k256_probe, .remove = mchp23k256_remove, |