450-14-mmc-block-set-fwnode-of-disk-devices.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From d9143f86330dd038fc48878558dd287ceee5d3d4 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Thu, 13 Jul 2023 04:13:04 +0100
  4. Subject: [PATCH 14/15] mmc: block: set fwnode of disk devices
  5. Set fwnode of disk devices to 'block', 'boot0' and 'boot1' subnodes of
  6. the mmc-card. This is done in preparation for having the eMMC act as
  7. NVMEM provider.
  8. Signed-off-by: Daniel Golle <[email protected]>
  9. ---
  10. drivers/mmc/core/block.c | 8 ++++++++
  11. 1 file changed, 8 insertions(+)
  12. --- a/drivers/mmc/core/block.c
  13. +++ b/drivers/mmc/core/block.c
  14. @@ -2463,6 +2463,8 @@ static struct mmc_blk_data *mmc_blk_allo
  15. int area_type,
  16. unsigned int part_type)
  17. {
  18. + struct fwnode_handle *fwnode;
  19. + struct device *ddev;
  20. struct mmc_blk_data *md;
  21. int devidx, ret;
  22. char cap_str[10];
  23. @@ -2559,6 +2561,13 @@ static struct mmc_blk_data *mmc_blk_allo
  24. blk_queue_write_cache(md->queue.queue, cache_enabled, fua_enabled);
  25. + ddev = disk_to_dev(md->disk);
  26. + fwnode = device_get_named_child_node(subname ? md->parent->parent :
  27. + md->parent,
  28. + subname ? subname : "block");
  29. + if (fwnode)
  30. + device_set_node(ddev, fwnode);
  31. +
  32. string_get_size((u64)size, 512, STRING_UNITS_2,
  33. cap_str, sizeof(cap_str));
  34. pr_info("%s: %s %s %s%s\n",