Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b40ff4d729f4a7a9f832c67aa5de0dfa8ad45c0
Commit:     9b40ff4d729f4a7a9f832c67aa5de0dfa8ad45c0
Parent:     69c202afa8ad6d6c1c673d8f9d47b43a0a3604e5
Author:     Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 12 00:52:41 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 12 09:48:30 2007 -0800

    [PATCH] spi: add spi_set_drvdata() and spi_get_drvdata()
    
    Add wrappers for getting and setting the driver data using spi_device
    instead of using dev_{get|set}_drvdata with &spi->dev, to mirror the
    platform_{get|set}_drvdata.
    
    Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 Documentation/spi/spi-summary |    2 +-
 include/linux/spi/spi.h       |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index 7279579..81b6230 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -312,7 +312,7 @@ might look like this unless you're creating a class_device:
                chip = kzalloc(sizeof *chip, GFP_KERNEL);
                if (!chip)
                        return -ENOMEM;
-               dev_set_drvdata(&spi->dev, chip);
+               spi_set_drvdata(spi, chip);
 
                ... etc
                return 0;
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 176f6e3..e25fcae 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -114,6 +114,17 @@ static inline void spi_set_ctldata(struct spi_device *spi, 
void *state)
        spi->controller_state = state;
 }
 
+/* device driver data */
+
+static inline void spi_set_drvdata(struct spi_device *spi, void *data)
+{
+       dev_set_drvdata(&spi->dev, data);
+}
+
+static inline void *spi_get_drvdata(struct spi_device *spi)
+{
+       return dev_get_drvdata(&spi->dev);
+}
 
 struct spi_message;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to