Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105440
b: refs/heads/master
c: 102eb97
h: refs/heads/master
v: v3
  • Loading branch information
Grant Likely authored and Linus Torvalds committed Jul 24, 2008
1 parent ddfdb8e commit 76d2403
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 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: 6291fe2abce4689d6ee7cbaea16692c79bf0d01b
refs/heads/master: 102eb97564c73ea73645b38599c5cbe6f54b030c
4 changes: 3 additions & 1 deletion trunk/drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ struct spi_device *spi_new_device(struct spi_master *master,
if (!spi_master_get(master))
return NULL;

WARN_ON(strlen(chip->modalias) >= sizeof(proxy->modalias));

proxy = kzalloc(sizeof *proxy, GFP_KERNEL);
if (!proxy) {
dev_err(dev, "can't alloc dev for cs%d\n",
Expand All @@ -229,7 +231,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
proxy->max_speed_hz = chip->max_speed_hz;
proxy->mode = chip->mode;
proxy->irq = chip->irq;
proxy->modalias = chip->modalias;
strlcpy(proxy->modalias, chip->modalias, sizeof(proxy->modalias));

snprintf(proxy->dev.bus_id, sizeof proxy->dev.bus_id,
"%s.%u", master->dev.bus_id,
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct spi_device {
int irq;
void *controller_state;
void *controller_data;
const char *modalias;
char modalias[32];

/*
* likely need more hooks for more protocol options affecting how
Expand Down

0 comments on commit 76d2403

Please sign in to comment.