mm/migrate_device: do not access pgmap for non zone device pages
page_pgmap() is referenced before checking if the page is a zone device
page and this triggers the warning in page_pgmap(). Refactor the code to
use the helper function after relevant checks.
Link: https://lkml.kernel.org/r/20250219231337.364133-1-balbirs@nvidia.com
Signed-off-by: Balbir Singh <balbirs@nvidia.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>