From: David Daney <ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 2/2] misc/at25: Add an .id_table to at25 to facilitate driver loading and binding.
Date: Wed, 22 Aug 2012 12:03:58 -0700 [thread overview]
Message-ID: <1345662238-15211-3-git-send-email-ddaney.cavm@gmail.com> (raw)
In-Reply-To: <1345662238-15211-1-git-send-email-ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
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 <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
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
next prev parent reply other threads:[~2012-08-22 19:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 19:03 [PATCH 0/2] SPI EEPROM / device tree interaction improvements David Daney
[not found] ` <1345662238-15211-1-git-send-email-ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-22 19:03 ` [PATCH 1/2] misc/at25, dt: Improve at25 SPI eeprom device tree bindings David Daney
[not found] ` <1345662238-15211-2-git-send-email-ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-09-05 22:57 ` Rob Herring
2012-08-22 19:03 ` David Daney [this message]
2012-09-17 7:49 ` [PATCH 2/2] misc/at25: Add an .id_table to at25 to facilitate driver loading and binding Ivo Sieben
[not found] ` <CAMSQXEHXG=DGT7egbSfdNb2VFTXS+HQ0DoaA2v9dTX_2zn2pZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-17 17:06 ` David Daney
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=1345662238-15211-3-git-send-email-ddaney.cavm@gmail.com \
--to=ddaney.cavm-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.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;
as well as URLs for NNTP newsgroup(s).