From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] mtd: m25p80: set driver id_table
Date: Fri, 7 Feb 2014 09:33:20 +0100 [thread overview]
Message-ID: <1391762000-19451-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1391762000-19451-1-git-send-email-s.hauer@pengutronix.de>
This sets the id_table in the driver correctly so that the driver
can match to the various types of flashes, not only "m25p80".
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/mtd/devices/m25p80.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 9594011..c36d240 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -73,11 +73,6 @@
#define SPI_NAME_SIZE 32
-struct spi_device_id {
- char name[SPI_NAME_SIZE];
- unsigned long driver_data;
-};
-
struct m25p {
struct spi_device *spi;
struct mtd_info mtd;
@@ -618,7 +613,7 @@ struct flash_info {
* more flash chips. This current list focusses on newer chips, which
* have been converging on command sets which including JEDEC ID.
*/
-static const struct spi_device_id m25p_ids[] = {
+static const struct platform_device_id m25p_ids[] = {
/* Atmel -- some are (confusingly) marketed as "DataFlash" */
{ "at25fs010", INFO(0x1f6601, 0, 32 * 1024, 4, SECT_4K) },
{ "at25fs040", INFO(0x1f6604, 0, 64 * 1024, 8, SECT_4K) },
@@ -755,7 +750,7 @@ static const struct spi_device_id m25p_ids[] = {
{ },
};
-static const struct spi_device_id *jedec_probe(struct spi_device *spi)
+static const struct platform_device_id *jedec_probe(struct spi_device *spi)
{
int tmp;
u8 code = OPCODE_RDID;
@@ -803,7 +798,7 @@ static const struct spi_device_id *jedec_probe(struct spi_device *spi)
static int m25p_probe(struct device_d *dev)
{
struct spi_device *spi = (struct spi_device *)dev->type_data;
- const struct spi_device_id *id = NULL;
+ const struct platform_device_id *id = NULL;
struct flash_platform_data *data;
struct m25p *flash;
struct flash_info *info = NULL;
@@ -819,7 +814,7 @@ static int m25p_probe(struct device_d *dev)
*/
data = dev->platform_data;
if (data && data->type) {
- const struct spi_device_id *plat_id;
+ const struct platform_device_id *plat_id;
for (i = 0; i < ARRAY_SIZE(m25p_ids) - 1; i++) {
plat_id = &m25p_ids[i];
@@ -840,7 +835,7 @@ static int m25p_probe(struct device_d *dev)
}
if (do_jdec_probe) {
- const struct spi_device_id *jid;
+ const struct platform_device_id *jid;
jid = jedec_probe(spi);
if (IS_ERR(jid)) {
@@ -969,6 +964,7 @@ static struct driver_d m25p80_driver = {
.name = "m25p80",
.probe = m25p_probe,
.of_compatible = DRV_OF_COMPAT(m25p80_dt_ids),
+ .id_table = (struct platform_device_id *)m25p_ids,
};
device_spi_driver(m25p80_driver);
--
1.8.5.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-02-07 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-07 8:33 match of_modaliases Sascha Hauer
2014-02-07 8:33 ` [PATCH 1/2] i2c/spi: " Sascha Hauer
2014-02-07 8:33 ` Sascha Hauer [this message]
2014-02-07 11:52 ` Lucas Stach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391762000-19451-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox