lkml.org 
[lkml]   [2014]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [can-next PATCH 1/1] net: can: c can platform : Use devm ioremap instead of devm ioremap re source.
Am 25-07-2014 08:19, schrieb Mugunthan V N:
> From: George Cherian <george.cherian@ti.com>
>
> The raminit register is shared register for both can0 and can1.
> Using devm_ioremap_resource fails the mapping for can1 interface
> leading to a non functional can interface.
>
> Signed-off-by: George Cherian <george.cherian@ti.com>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

The patch is a hack, or? It simply works because we drop all sanity
checking on the resource.

I am on holiday and can't really check, yet I believe the AM335x has
devicetree support for accessing single bits in SYSCONF. This is what
needs to be applied here, too, AFAICT.

> ---
> drivers/net/can/c_can/c_can_platform.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/c_can/c_can_platform.c
> b/drivers/net/can/c_can/c_can_platform.c
> index e29b6d0..5dede6e 100644
> --- a/drivers/net/can/c_can/c_can_platform.c
> +++ b/drivers/net/can/c_can/c_can_platform.c
> @@ -278,7 +278,8 @@ static int c_can_plat_probe(struct platform_device
> *pdev)
> break;
> }
>
> - priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res);
> + priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start,
> + resource_size(res));
> if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
> dev_info(&pdev->dev, "control memory is not used for raminit\n");
> else


\
 
 \ /
  Last update: 2014-07-25 13:21    [W:0.076 / U:1.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site