From: Wolfram Sang <wsa@sang-engineering.com>
To: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Pavel Machek <pavel@denx.de>, Thor Thayer <tthayer@altera.com>,
Prabhakar Lad <prabhakar.csengg@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Chen Gang <gang.chen@asianux.com>,
George Cherian <george.cherian@ti.com>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [can-next PATCH 1/1] net: can: c_can_platform: Use devm_ioremap instead of devm_ioremap_resource.
Date: Fri, 25 Jul 2014 12:49:25 +0200 [thread overview]
Message-ID: <4a97162dedd6ab064e83c52757f2ce42@mail.zeus03.de> (raw)
In-Reply-To: <1406269181-4092-1-git-send-email-mugunthanvnm@ti.com>
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
next prev parent reply other threads:[~2014-07-25 10:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 6:19 [can-next PATCH 1/1] net: can: c_can_platform: Use devm_ioremap instead of devm_ioremap_resource Mugunthan V N
2014-07-25 7:38 ` Marc Kleine-Budde
2014-07-25 10:49 ` Wolfram Sang [this message]
2014-07-25 13:06 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a97162dedd6ab064e83c52757f2ce42@mail.zeus03.de \
--to=wsa@sang-engineering.com \
--cc=gang.chen@asianux.com \
--cc=george.cherian@ti.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=pavel@denx.de \
--cc=prabhakar.csengg@gmail.com \
--cc=tglx@linutronix.de \
--cc=tthayer@altera.com \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).