1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2016, Intel Corporation.
5 #include "test/nfit_test.h"
7 #include "../../../drivers/dax/dax-private.h"
9 phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
12 struct resource *res = &dev_dax->region->res;
15 addr = pgoff * PAGE_SIZE + res->start;
16 if (addr >= res->start && addr <= res->end) {
17 if (addr + size - 1 <= res->end) {
18 if (get_nfit_res(addr)) {
21 if (dev_dax->region->align > PAGE_SIZE)
24 page = vmalloc_to_page((void *)addr);
25 return PFN_PHYS(page_to_pfn(page));