Re: [PATCH 2/2] misc/at25: Add an .id_table to at25 to facilitate driver loading and binding.
On 09/17/2012 12:49 AM, Ivo Sieben wrote: Hi, 2012/8/22 David Daney : From: David Daney /*-*/ +static const struct spi_device_id at25_id[] = { + {"at25", 0}, + {"m95256", 0}, + { } +}; +MODULE_DEVICE_TABLE(spi, at25_id); I use this driver for the ST M95040, M95020 & M95010 eeprom devices. So wouldn't it be better to use the "famliy" name for these chips ("m95" instead of "m95256"). These are matched against device tree compatible properties. You could propose adding a generic "st,95xxx" compatible property and adding that to the at25_id list. But I don't think we want to remove "m95256", as we have deployed devices using this binding. David Daney -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] misc/at25: Add an .id_table to at25 to facilitate driver loading and binding.
Hi, 2012/8/22 David Daney : > From: David Daney > > /*-*/ > +static const struct spi_device_id at25_id[] = { > + {"at25", 0}, > + {"m95256", 0}, > + { } > +}; > +MODULE_DEVICE_TABLE(spi, at25_id); I use this driver for the ST M95040, M95020 & M95010 eeprom devices. So wouldn't it be better to use the "famliy" name for these chips ("m95" instead of "m95256"). Regards, Ivo Sieben -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] misc/at25: Add an .id_table to at25 to facilitate driver loading and binding.
From: David Daney With this patch we get automatic driver loading and binding for device tree specified hardware typologies. Also recognize "st,m95256" devices as being compatible with the driver. Signed-off-by: David Daney --- drivers/misc/eeprom/at25.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index 4ed93dd..bd4a6c7 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -470,12 +470,19 @@ static int __devexit at25_remove(struct spi_device *spi) } /*-*/ +static const struct spi_device_id at25_id[] = { + {"at25", 0}, + {"m95256", 0}, + { } +}; +MODULE_DEVICE_TABLE(spi, at25_id); static struct spi_driver at25_driver = { .driver = { .name = "at25", .owner = THIS_MODULE, }, + .id_table = at25_id, .probe = at25_probe, .remove = __devexit_p(at25_remove), }; @@ -485,4 +492,3 @@ module_spi_driver(at25_driver); MODULE_DESCRIPTION("Driver for most SPI EEPROMs"); MODULE_AUTHOR("David Brownell"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("spi:at25"); -- 1.7.11.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/