[PATCH 1/7] generic_memmap_ro/rw: switch to resource

Marc Kleine-Budde mkl at pengutronix.de
Fri Jul 29 06:22:08 EDT 2011


On 07/29/2011 07:52 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> ---
>  drivers/base/driver.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/driver.c b/drivers/base/driver.c
> index b5166c8..3efb538 100644
> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -263,7 +263,7 @@ int generic_memmap_ro(struct cdev *cdev, void **map, int flags)
>  
>  	if (flags & PROT_WRITE)
>  		return -EACCES;
> -	*map = (void *)cdev->dev->map_base;
> +	*map = dev_get_mem_region(cdev->dev, 0);
>  	return 0;
>  }
>  
> @@ -272,7 +272,8 @@ int generic_memmap_rw(struct cdev *cdev, void **map, int flags)
>  	if (!cdev->dev)
>  		return -EINVAL;
>  
> -	*map = (void *)cdev->dev->map_base;
> +	*map = dev_get_mem_region(cdev->dev, 0);
> +	return 0;
>  	return 0;

one return should be enough
>  }
>  

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20110729/a8355d03/attachment.sig>


More information about the barebox mailing list