1 --- a/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
2 +++ b/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
3 @@ -16,4 +16,8 @@ struct ath79_spi_platform_data {
4 unsigned num_chipselect;
7 +struct ath79_spi_controller_data {
11 #endif /* _ATH79_SPI_PLATFORM_H */
12 --- a/drivers/spi/spi-ath79.c
13 +++ b/drivers/spi/spi-ath79.c
14 @@ -79,8 +79,10 @@ static void ath79_spi_chipselect(struct
17 if (spi->chip_select) {
18 + struct ath79_spi_controller_data *cdata = spi->controller_data;
20 /* SPI is normally active-low */
21 - gpio_set_value(spi->cs_gpio, cs_high);
22 + gpio_set_value(cdata->gpio, cs_high);
25 sp->ioc_base |= AR71XX_SPI_IOC_CS0;
26 @@ -116,9 +118,10 @@ static void ath79_spi_disable(struct ath
27 static int ath79_spi_setup_cs(struct spi_device *spi)
29 struct ath79_spi *sp = ath79_spidev_to_sp(spi);
30 + struct ath79_spi_controller_data *cdata = spi->controller_data;
33 - if (spi->chip_select && !gpio_is_valid(spi->cs_gpio))
34 + if (spi->chip_select && (!cdata || !gpio_is_valid(cdata->gpio)))
38 @@ -131,7 +134,7 @@ static int ath79_spi_setup_cs(struct spi
40 flags |= GPIOF_INIT_HIGH;
42 - status = gpio_request_one(spi->cs_gpio, flags,
43 + status = gpio_request_one(cdata->gpio, flags,
46 if (spi->mode & SPI_CS_HIGH)
47 @@ -148,7 +151,8 @@ static int ath79_spi_setup_cs(struct spi
48 static void ath79_spi_cleanup_cs(struct spi_device *spi)
50 if (spi->chip_select) {
51 - gpio_free(spi->cs_gpio);
52 + struct ath79_spi_controller_data *cdata = spi->controller_data;
53 + gpio_free(cdata->gpio);
57 @@ -220,7 +224,6 @@ static int ath79_spi_probe(struct platfo
60 sp = spi_master_get_devdata(master);
61 - master->dev.of_node = pdev->dev.of_node;
62 platform_set_drvdata(pdev, sp);
64 pdata = dev_get_platdata(&pdev->dev);
65 @@ -300,18 +303,12 @@ static void ath79_spi_shutdown(struct pl
66 ath79_spi_remove(pdev);
69 -static const struct of_device_id ath79_spi_of_match[] = {
70 - { .compatible = "qca,ar7100-spi", },
74 static struct platform_driver ath79_spi_driver = {
75 .probe = ath79_spi_probe,
76 .remove = ath79_spi_remove,
77 .shutdown = ath79_spi_shutdown,
80 - .of_match_table = ath79_spi_of_match,
83 module_platform_driver(ath79_spi_driver);