* [PATCH] can: flexcan: use of_property_read_u32 to avoid endian problem
@ 2012-06-28 2:58 Hui Wang
2012-06-28 3:32 ` Shawn Guo
0 siblings, 1 reply; 4+ messages in thread
From: Hui Wang @ 2012-06-28 2:58 UTC (permalink / raw)
To: mkl, davem, shawn.guo, wg; +Cc: linux-can
Use of_property_read_u32() to get DT value can avoid endian problems,
this is needed since this driver can run on powerpc (be) and arm (le).
No need to check ret value here since we will check the got value to
verify if users pass a valid value in the DT.
Cc: linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Hui Wang <jason77.wang@gmail.com>
---
This is the patch to replace the one "can: flexcan: use be32_to_cpup
to handle the value of dt entry", if you already applied that patch
and can't revert, please ignore this patch and let me know,i will
prepare an incremental patch basing on that one.
drivers/net/can/flexcan.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 38c0690..f63f826 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -938,14 +938,9 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
if (IS_ERR(pinctrl))
return PTR_ERR(pinctrl);
- if (pdev->dev.of_node) {
- const u32 *clock_freq_p;
-
- clock_freq_p = of_get_property(pdev->dev.of_node,
- "clock-frequency", NULL);
- if (clock_freq_p)
- clock_freq = *clock_freq_p;
- }
+ if (pdev->dev.of_node)
+ of_property_read_u32(pdev->dev.of_node,
+ "clock-frequency", &clock_freq);
if (!clock_freq) {
clk = clk_get(&pdev->dev, NULL);
--
1.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] can: flexcan: use of_property_read_u32 to avoid endian problem
2012-06-28 2:58 [PATCH] can: flexcan: use of_property_read_u32 to avoid endian problem Hui Wang
@ 2012-06-28 3:32 ` Shawn Guo
2012-06-28 5:06 ` Oliver Hartkopp
0 siblings, 1 reply; 4+ messages in thread
From: Shawn Guo @ 2012-06-28 3:32 UTC (permalink / raw)
To: Hui Wang; +Cc: mkl, davem, wg, linux-can
On 28 June 2012 10:58, Hui Wang <jason77.wang@gmail.com> wrote:
> Use of_property_read_u32() to get DT value can avoid endian problems,
> this is needed since this driver can run on powerpc (be) and arm (le).
>
> No need to check ret value here since we will check the got value to
> verify if users pass a valid value in the DT.
>
> Cc: linux-can@vger.kernel.org
> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> Signed-off-by: Hui Wang <jason77.wang@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] can: flexcan: use of_property_read_u32 to avoid endian problem
2012-06-28 3:32 ` Shawn Guo
@ 2012-06-28 5:06 ` Oliver Hartkopp
2012-06-28 5:18 ` Hui Wang
0 siblings, 1 reply; 4+ messages in thread
From: Oliver Hartkopp @ 2012-06-28 5:06 UTC (permalink / raw)
To: Shawn Guo, Hui Wang; +Cc: mkl, wg, linux-can
The first patch (you wanted to superseed) has already been pulled from Dave
Miller, see:
http://git.kernel.org/?p=linux/kernel/git/davem/net.git;a=commitdiff;h=85f2f834e85517307f13e30e630a5fc86f757cb5
If you want to update your patch you need to do this based on your already
accepted patch.
Regards,
Oliver
Btw. no need to put Dave Miller in all your CAN-related postings in CC. He
get's hundreds of mails each day ...
On 28.06.2012 05:32, Shawn Guo wrote:
> On 28 June 2012 10:58, Hui Wang <jason77.wang@gmail.com> wrote:
>> Use of_property_read_u32() to get DT value can avoid endian problems,
>> this is needed since this driver can run on powerpc (be) and arm (le).
>>
>> No need to check ret value here since we will check the got value to
>> verify if users pass a valid value in the DT.
>>
>> Cc: linux-can@vger.kernel.org
>> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Shawn Guo <shawn.guo@linaro.org>
>
> Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
>
>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>> Signed-off-by: Hui Wang <jason77.wang@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] can: flexcan: use of_property_read_u32 to avoid endian problem
2012-06-28 5:06 ` Oliver Hartkopp
@ 2012-06-28 5:18 ` Hui Wang
0 siblings, 0 replies; 4+ messages in thread
From: Hui Wang @ 2012-06-28 5:18 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Shawn Guo, Hui Wang, mkl, wg, linux-can
Oliver Hartkopp wrote:
> The first patch (you wanted to superseed) has already been pulled from Dave
> Miller, see:
>
> http://git.kernel.org/?p=linux/kernel/git/davem/net.git;a=commitdiff;h=85f2f834e85517307f13e30e630a5fc86f757cb5
>
> If you want to update your patch you need to do this based on your already
> accepted patch.
>
Got it, i will generate an incremental patch basing on it.
> Regards,
> Oliver
>
> Btw. no need to put Dave Miller in all your CAN-related postings in CC. He
> get's hundreds of mails each day ...
>
OK.
Regards,
Hui.
> On 28.06.2012 05:32, Shawn Guo wrote:
>
>
>> On 28 June 2012 10:58, Hui Wang <jason77.wang@gmail.com> wrote:
>>
>>> Use of_property_read_u32() to get DT value can avoid endian problems,
>>> this is needed since this driver can run on powerpc (be) and arm (le).
>>>
>>> No need to check ret value here since we will check the got value to
>>> verify if users pass a valid value in the DT.
>>>
>>> Cc: linux-can@vger.kernel.org
>>> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
>>> Cc: David S. Miller <davem@davemloft.net>
>>> Cc: Shawn Guo <shawn.guo@linaro.org>
>>>
>> Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
>>
>>
>>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>>> Signed-off-by: Hui Wang <jason77.wang@gmail.com>
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-28 5:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 2:58 [PATCH] can: flexcan: use of_property_read_u32 to avoid endian problem Hui Wang
2012-06-28 3:32 ` Shawn Guo
2012-06-28 5:06 ` Oliver Hartkopp
2012-06-28 5:18 ` Hui Wang
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).