Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299170
b: refs/heads/master
c: 39ec0d3
h: refs/heads/master
v: v3
  • Loading branch information
Lothar Waßmann authored and Grant Likely committed Apr 11, 2012
1 parent 127fd5c commit 2022bd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: cc4d22ae541ccd989ef163c46a38afde131e1644
refs/heads/master: 39ec0d38141b198f94fd19c2bb10fd7c616510d2
10 changes: 7 additions & 3 deletions trunk/drivers/spi/spi-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,12 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
}

ret = of_property_read_u32(np, "fsl,spi-num-chipselects", &num_cs);
if (ret < 0)
num_cs = mxc_platform_info->num_chipselect;
if (ret < 0) {
if (mxc_platform_info)
num_cs = mxc_platform_info->num_chipselect;
else
return ret;
}

master = spi_alloc_master(&pdev->dev,
sizeof(struct spi_imx_data) + sizeof(int) * num_cs);
Expand All @@ -784,7 +788,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)

for (i = 0; i < master->num_chipselect; i++) {
int cs_gpio = of_get_named_gpio(np, "cs-gpios", i);
if (cs_gpio < 0)
if (cs_gpio < 0 && mxc_platform_info)
cs_gpio = mxc_platform_info->chipselect[i];

spi_imx->chipselect[i] = cs_gpio;
Expand Down

0 comments on commit 2022bd2

Please sign in to comment.