Skip to content

Commit

Permalink
powerpc/5200: Fix size to request_mem_region() call
Browse files Browse the repository at this point in the history
The Bestcomm driver requests a memory region larger than the one
described in the device tree. This is due to an extra undocumented field
in the bestcomm register structure. This hasn't been a problem up to
now, but there is a patch pending to make the DT platform_bus support
code use platform_device_add() which tightens the rules and provides
extra checks for drivers to stay within the specified register regions.

Alternately, I could have removed the extra field from the structure,
but I'm not sure if it is still needed for resume to work. Better be
safe and leave it in.

Signed-off-by: Grant Likely <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Anatolij Gustschin <[email protected]>
  • Loading branch information
glikely committed Feb 6, 2013
1 parent f21ccfa commit b5961f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/bestcomm/bestcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op)
goto error_sramclean;
}

if (!request_mem_region(res_bcom.start, sizeof(struct mpc52xx_sdma),
if (!request_mem_region(res_bcom.start, resource_size(&res_bcom),
DRIVER_NAME)) {
printk(KERN_ERR DRIVER_NAME ": "
"Can't request registers region\n");
Expand Down

0 comments on commit b5961f8

Please sign in to comment.