Skip to content

Commit 0c34579

Browse files
rmurphy-armjoergroedel
authored andcommitted
OF: Retire dma-ranges mask workaround
The fixup adding 1 to the dma-ranges size may have been for the benefit of some early AMD Seattle DTs, or may have merely been a just-in-case, but either way anyone who might have deserved to get the message has hopefully seen the warning in the 9 years we've had it there. The modern dma_range_map mechanism should happily handle odd-sized ranges with no ill effect, so there's little need to care anyway now. Clean it up. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/26620039901fdae52079ec1c8a4b2b324964a13e.1713523152.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent d2f85a2 commit 0c34579

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

drivers/of/device.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
129129
dma_end = r->dma_start + r->size;
130130
}
131131
size = dma_end - dma_start;
132-
133-
/*
134-
* Add a work around to treat the size as mask + 1 in case
135-
* it is defined in DT as a mask.
136-
*/
137-
if (size & 1) {
138-
dev_warn(dev, "Invalid size 0x%llx for dma-range(s)\n",
139-
size);
140-
size = size + 1;
141-
}
142-
143-
if (!size) {
144-
dev_err(dev, "Adjusted size 0x%llx invalid\n", size);
145-
kfree(map);
146-
return -EINVAL;
147-
}
148132
}
149133

150134
/*

0 commit comments

Comments
 (0)