Skip to content

Commit

Permalink
mmc: block: set fwnode of disk devices
Browse files Browse the repository at this point in the history
Set fwnode of disk devices to 'block', 'boot0' and 'boot1' subnodes of
the mmc-card. This is done in preparation for having the eMMC act as
NVMEM provider.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information
dangowrt committed Nov 25, 2023
1 parent 65122ec commit 70e6bdc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/mmc/core/block.c
Expand Up @@ -2419,6 +2419,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
int area_type,
unsigned int part_type)
{
struct fwnode_handle *fwnode;
struct device *ddev;
struct mmc_blk_data *md;
int devidx, ret;
char cap_str[10];
Expand Down Expand Up @@ -2515,6 +2517,12 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,

blk_queue_write_cache(md->queue.queue, cache_enabled, fua_enabled);

ddev = disk_to_dev(md->disk);
fwnode = device_get_named_child_node(subname ? md->parent->parent :
md->parent,
subname ? subname : "block");
ddev->fwnode = fwnode;

string_get_size((u64)size, 512, STRING_UNITS_2,
cap_str, sizeof(cap_str));
pr_info("%s: %s %s %s%s\n",
Expand Down

0 comments on commit 70e6bdc

Please sign in to comment.