Do not require init_done for some deive helpers.

It processes only name, no need to depend on real device
checks (for direct-io) etc.
This commit is contained in:
Milan Broz
2023-11-15 13:39:27 +01:00
parent 722c77c883
commit d3cc5e846a

View File

@@ -470,7 +470,7 @@ void device_free(struct crypt_device *cd, struct device *device)
/* Get block device path */
const char *device_block_path(const struct device *device)
{
if (!device || !device->init_done)
if (!device)
return NULL;
return device->path;
@@ -482,7 +482,7 @@ const char *device_dm_name(const struct device *device)
const char *dmdir = dm_get_dir();
size_t dmdir_len = strlen(dmdir);
if (!device || !device->init_done)
if (!device)
return NULL;
if (strncmp(device->path, dmdir, dmdir_len))