Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvme: Use libnvme sysfs function to get NVMe controller directory #2255

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -5256,7 +5256,7 @@ static void *mmap_registers(struct nvme_dev *dev)
void *membase;
int fd;

sprintf(path, "/sys/class/nvme/%s/device/resource0", dev->name);
sprintf(path, "%s/%s/device/resource0", nvme_ctrl_sysfs_dir(), dev->name);
fd = open(path, O_RDONLY);
if (fd < 0) {
if (log_level >= LOG_DEBUG)
Expand Down
2 changes: 0 additions & 2 deletions nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ enum nvme_cli_topo_ranking {
NVME_CLI_TOPO_CTRL,
};

#define SYS_NVME "/sys/class/nvme"

enum nvme_dev_type {
NVME_DEV_DIRECT,
NVME_DEV_MI,
Expand Down
Loading