提交 50f426b5 编写于 作者: B Ben Dooks 提交者: Linus Torvalds

spi: spi_s3c24xx must initialize bus_num

Pass the bus number we expect the S3C24XX SPI driver to attach to via the
platform data.
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4bb5eba0
...@@ -238,6 +238,7 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev) ...@@ -238,6 +238,7 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
static int __init s3c24xx_spi_probe(struct platform_device *pdev) static int __init s3c24xx_spi_probe(struct platform_device *pdev)
{ {
struct s3c2410_spi_info *pdata;
struct s3c24xx_spi *hw; struct s3c24xx_spi *hw;
struct spi_master *master; struct spi_master *master;
struct resource *res; struct resource *res;
...@@ -254,10 +255,10 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev) ...@@ -254,10 +255,10 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
memset(hw, 0, sizeof(struct s3c24xx_spi)); memset(hw, 0, sizeof(struct s3c24xx_spi));
hw->master = spi_master_get(master); hw->master = spi_master_get(master);
hw->pdata = pdev->dev.platform_data; hw->pdata = pdata = pdev->dev.platform_data;
hw->dev = &pdev->dev; hw->dev = &pdev->dev;
if (hw->pdata == NULL) { if (pdata == NULL) {
dev_err(&pdev->dev, "No platform data supplied\n"); dev_err(&pdev->dev, "No platform data supplied\n");
err = -ENOENT; err = -ENOENT;
goto err_no_pdata; goto err_no_pdata;
...@@ -333,13 +334,13 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev) ...@@ -333,13 +334,13 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
/* setup any gpio we can */ /* setup any gpio we can */
if (!hw->pdata->set_cs) { if (!pdata->set_cs) {
hw->set_cs = s3c24xx_spi_gpiocs; hw->set_cs = s3c24xx_spi_gpiocs;
s3c2410_gpio_setpin(hw->pdata->pin_cs, 1); s3c2410_gpio_setpin(pdata->pin_cs, 1);
s3c2410_gpio_cfgpin(hw->pdata->pin_cs, S3C2410_GPIO_OUTPUT); s3c2410_gpio_cfgpin(pdata->pin_cs, S3C2410_GPIO_OUTPUT);
} else } else
hw->set_cs = hw->pdata->set_cs; hw->set_cs = pdata->set_cs;
/* register our spi controller */ /* register our spi controller */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册