Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7d96929 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/bar: behave better if ioremap failed



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent e715396a
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -99,9 +99,14 @@ nouveau_bar_alloc(struct nouveau_bar *bar, struct nouveau_object *parent,
		  struct nouveau_mem *mem, struct nouveau_object **pobject)
{
	struct nouveau_object *engine = nv_object(bar);
	return nouveau_object_ctor(parent, engine, &nouveau_barobj_oclass,
	int ret = -ENOMEM;
	if (bar->iomem) {
		ret = nouveau_object_ctor(parent, engine,
					  &nouveau_barobj_oclass,
					  mem, 0, pobject);
	}
	return ret;
}

int
nouveau_bar_create_(struct nouveau_object *parent,
@@ -118,9 +123,12 @@ nouveau_bar_create_(struct nouveau_object *parent,
	if (ret)
		return ret;

	if (nv_device_resource_len(device, 3) != 0)
	if (nv_device_resource_len(device, 3) != 0) {
		bar->iomem = ioremap(nv_device_resource_start(device, 3),
				     nv_device_resource_len(device, 3));
		if (!bar->iomem)
			nv_warn(bar, "PRAMIN ioremap failed\n");
	}

	return 0;
}