084-0001-spi-bcm53xx-set-of_node-to-let-DT-specify-device-s.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 78d759daceaf0a7058f37c4142bdca9948b6d987 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Thu, 29 Dec 2016 17:27:55 +0100
  4. Subject: [PATCH] spi: bcm53xx: set of_node to let DT specify device(s)
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Setting of_node of master's dev seems to be a common way of letting it
  9. work nicely with DT. This allows specifying device there instead of
  10. hardcoding one in the driver code.
  11. This was successfully tested with commit 1b47b98acce2 ("ARM: BCM5301X:
  12. Add DT entry for SPI controller and NOR flash")
  13. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  14. Signed-off-by: Mark Brown <broonie@kernel.org>
  15. ---
  16. drivers/spi/spi-bcm53xx.c | 8 +-------
  17. 1 file changed, 1 insertion(+), 7 deletions(-)
  18. --- a/drivers/spi/spi-bcm53xx.c
  19. +++ b/drivers/spi/spi-bcm53xx.c
  20. @@ -275,10 +275,6 @@ static int bcm53xxspi_flash_read(struct
  21. * BCMA
  22. **************************************************/
  23. -static struct spi_board_info bcm53xx_info = {
  24. - .modalias = "bcm53xxspiflash",
  25. -};
  26. -
  27. static const struct bcma_device_id bcm53xxspi_bcma_tbl[] = {
  28. BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_QSPI, BCMA_ANY_REV, BCMA_ANY_CLASS),
  29. {},
  30. @@ -311,6 +307,7 @@ static int bcm53xxspi_bcma_probe(struct
  31. b53spi->bspi = true;
  32. bcm53xxspi_disable_bspi(b53spi);
  33. + master->dev.of_node = dev->of_node;
  34. master->transfer_one = bcm53xxspi_transfer_one;
  35. if (b53spi->mmio_base)
  36. master->spi_flash_read = bcm53xxspi_flash_read;
  37. @@ -324,9 +321,6 @@ static int bcm53xxspi_bcma_probe(struct
  38. return err;
  39. }
  40. - /* Broadcom SoCs (at least with the CC rev 42) use SPI for flash only */
  41. - spi_new_device(master, &bcm53xx_info);
  42. -
  43. return 0;
  44. }