414-MTD-m25p80-allow-passing-pp_data.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 7f17dfe9009beb07a3de0e380932a725293829df Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jonas.gorski@gmail.com>
  3. Date: Tue, 1 May 2012 17:33:03 +0200
  4. Subject: [PATCH 64/79] MTD: m25p80: allow passing pp_data
  5. ---
  6. drivers/mtd/devices/m25p80.c | 3 +++
  7. include/linux/spi/flash.h | 2 ++
  8. 2 files changed, 5 insertions(+)
  9. --- a/drivers/mtd/devices/m25p80.c
  10. +++ b/drivers/mtd/devices/m25p80.c
  11. @@ -267,6 +267,9 @@ static int m25p_probe(struct spi_device
  12. if (data)
  13. flash->max_transfer_len = data->max_transfer_len;
  14. + if (data && data->pp_data)
  15. + memcpy(&ppdata, data->pp_data, sizeof(ppdata));
  16. +
  17. ret = spi_nor_scan(nor, flash_name, mode);
  18. if (ret)
  19. return ret;
  20. --- a/include/linux/spi/flash.h
  21. +++ b/include/linux/spi/flash.h
  22. @@ -12,6 +12,7 @@ struct mtd_part_parser_data;
  23. * with chips that can't be queried for JEDEC or other IDs
  24. * @part_probe_types: optional list of MTD parser names to use for
  25. * partitioning
  26. + * @pp_data: optional partition parser data.
  27. *
  28. * @max_transfer_len: option maximum read/write length limitation for
  29. * SPI controllers not able to transfer any length commands.
  30. @@ -30,6 +31,7 @@ struct flash_platform_data {
  31. char *type;
  32. const char **part_probe_types;
  33. + struct mtd_part_parser_data *pp_data;
  34. unsigned int max_transfer_len;
  35. /* we'll likely add more ... use JEDEC IDs, etc */