Re: [PATCH] rcar_can: add device tree support
From: Sergei Shtylyov <hidden>
Date: 2014-07-02 21:43:17
Also in:
linux-can, linux-devicetree, linux-sh
Hello. On 07/02/2014 02:50 AM, Marc Kleine-Budde wrote:
quoted
Add support of the device tree probing for the Renesas R-Car CAN controllers documenting the device tree bindings as necessary.
Please put the DT documentation into a separate patch, make it the first
OK.
one. When reposting, please put the device tree mailing list on Cc.
It was among the To: recipients in this posting; I'm using
scripts/get_maintainer.pl to find out the people/lists I should send the
patches to.
quoted
Signed-off-by: Sergei Shtylyov <redacted>
quoted
--- The patch is against the Dave Miller's 'net-next.git' repo ('linux-can-next.git' repo still doesn't have the R-Car CAN driver for some reason).
Should be fixed now :)
Indeed, thanks.
quoted
Documentation/devicetree/bindings/net/can/rcar_can.txt | 40 +++++++++++++++++ drivers/net/can/rcar_can.c | 28 +++++++++-- 2 files changed, 63 insertions(+), 5 deletions(-)
quoted
Index: net-next/Documentation/devicetree/bindings/net/can/rcar_can.txt ===================================================================--- /dev/null +++ net-next/Documentation/devicetree/bindings/net/can/rcar_can.txt@@ -0,0 +1,40 @@ +Renesas R-Car CAN controller Device Tree Bindings +------------------------------------------------- + +Required properties: +- compatible: "renesas,can-r8a7778" if CAN controller is a part of R8A7778 SoC. + "renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC. + "renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC. + "renesas,can-r8a7791" if CAN controller is a part of R8A7791 SoC.
AFAIK we usually specify the first SoC with this core as the only compatible.
The reason we've chosen several SoC specific "compatible" props is that in
the SH-Mobile community the maintainers want it this way. There's no version
register in the IP blocks and the SoC manuals we have are not considered
reliable enough sources of information, so that the compatibility between the
different SoCs cannot be reliably established...
[...]quoted
Index: net-next/drivers/net/can/rcar_can.c ===================================================================--- net-next.orig/drivers/net/can/rcar_can.c +++ net-next/drivers/net/can/rcar_can.c
[...]
quoted
@@ -722,13 +723,20 @@ static int rcar_can_probe(struct platfor struct net_device *ndev; struct resource *mem; void __iomem *addr; + u32 clock_select = 0; int err = -ENODEV; int irq; - pdata = dev_get_platdata(&pdev->dev); - if (!pdata) { - dev_err(&pdev->dev, "No platform data provided!\n"); - goto fail; + if (!pdev->dev.of_node) {
nitpick: please make it positive logic.
OK, will do.
Marc
WBR, Sergei