From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "bhupesh.sharma@freescale.com" <bhupesh.sharma@freescale.com>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: "wg@grandegger.com" <wg@grandegger.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] net: can: Remodel FlexCAN register read/write APIs for BE instances
Date: Thu, 26 Jun 2014 11:35:13 +0200 [thread overview]
Message-ID: <53ABE951.8060800@pengutronix.de> (raw)
In-Reply-To: <c02d4c6ac71d432bb99a547e3e17d027@BN1PR03MB220.namprd03.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]
On 06/26/2014 11:30 AM, bhupesh.sharma@freescale.com wrote:
>
>
>> -----Original Message-----
>> From: Marc Kleine-Budde [mailto:mkl@pengutronix.de]
>> Sent: Thursday, June 26, 2014 2:59 PM
>> To: Sharma Bhupesh-B45370; linux-can@vger.kernel.org
>> Cc: wg@grandegger.com; netdev@vger.kernel.org
>> Subject: Re: [PATCH] net: can: Remodel FlexCAN register read/write APIs
>> for BE instances
>>
>> On 06/25/2014 09:00 PM, Marc Kleine-Budde wrote:
>>>> How does this look (a bit messed up, so I am open for comments):
>>>
>>> What about:
>>>
>>> static u32 flexcan_read_le(void __iomem *addr) {
>>> return ioread32(addr);
>>> }
>>>
>>> static u32 flexcan_read_be(void __iomem *addr) {
>>> return ioread32be(addr);
>>> }
>>>
>>> flexcan_probe ()
>>> {
>>> bool core_is_little = true;
>>>
>>> /* or #ifdef __BIG_ENDIAN ... #endif instead of IS_ENABLED() */
>>> if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) ||
>>> of_property_read_bool(dev->dev.of_node, "big-endian"))
>>> core_is_little = false;
>>
>> if (of_property_read_bool(dev->dev.of_node, "little-endian"))
>> core_is_little = true;
>
> Seems better :)
>
> Let me try to spin a patch and test it at my end.
Totally untested this is :)
BTW: Please make an update to the DT bindings as a separate patch. This
patch should be the first one. Once the dust is settled, add the device
tree discussion mailing list on CC.
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 |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
next prev parent reply other threads:[~2014-06-26 9:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 15:54 [PATCH] net: can: Remodel FlexCAN register read/write APIs for BE instances Bhupesh Sharma
2014-06-25 8:27 ` Marc Kleine-Budde
2014-06-25 9:41 ` bhupesh.sharma
2014-06-25 10:26 ` Marc Kleine-Budde
2014-06-25 11:01 ` bhupesh.sharma
2014-06-25 11:07 ` Marc Kleine-Budde
2014-06-25 14:16 ` bhupesh.sharma
2014-06-25 19:00 ` Marc Kleine-Budde
2014-06-26 9:28 ` Marc Kleine-Budde
2014-06-26 9:30 ` bhupesh.sharma
2014-06-26 9:35 ` Marc Kleine-Budde [this message]
2014-06-25 10:29 ` David Laight
2014-06-25 10:34 ` Marc Kleine-Budde
2014-06-25 8:58 ` David Laight
2014-06-25 9:55 ` bhupesh.sharma
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=53ABE951.8060800@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=bhupesh.sharma@freescale.com \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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).