Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47928
b: refs/heads/master
c: 9b40ff4
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks authored and Linus Torvalds committed Feb 12, 2007
1 parent 5ca1fc0 commit f58201b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69c202afa8ad6d6c1c673d8f9d47b43a0a3604e5
refs/heads/master: 9b40ff4d729f4a7a9f832c67aa5de0dfa8ad45c0
2 changes: 1 addition & 1 deletion trunk/Documentation/spi/spi-summary
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions trunk/include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f58201b

Please sign in to comment.