Re: [PATCH v3 22/42] dma: cirrus: add DT support for Cirrus EP93xx
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH v3 22/42] dma: cirrus: add DT support for Cirrus EP93xx
- From: Andy Shevchenko <andy@xxxxxxxxxx>
- Date: Fri, 21 Jul 2023 19:20:58 +0300
- Cc: Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>, Lennert Buytenhek <kernel@xxxxxxxxxxxxxx>, Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Lukasz Majewski <lukma@xxxxxxx>, Linus Walleij <linus.walleij@xxxxxxxxxx>, Bartosz Golaszewski <brgl@xxxxxxxx>, Rob Herring <robh+dt@xxxxxxxxxx>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@xxxxxxxxxx>, Conor Dooley <conor+dt@xxxxxxxxxx>, Michael Turquette <mturquette@xxxxxxxxxxxx>, Stephen Boyd <sboyd@xxxxxxxxxx>, Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Alessandro Zummo <a.zummo@xxxxxxxxxxxx>, Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>, Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>, Guenter Roeck <linux@xxxxxxxxxxxx>, Sebastian Reichel <sre@xxxxxxxxxx>, Thierry Reding <thierry.reding@xxxxxxxxx>, Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>, Vinod Koul <vkoul@xxxxxxxxxx>, Miquel Raynal <miquel.raynal@xxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Vignesh Raghavendra <vigneshr@xxxxxx>, Damien Le Moal <dlemoal@xxxxxxxxxx>, Sergey Shtylyov <s.shtylyov@xxxxxx>, Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Olof Johansson <olof@xxxxxxxxx>, soc@xxxxxxxxxx, Liam Girdwood <lgirdwood@xxxxxxxxx>, Jaroslav Kysela <perex@xxxxxxxx>, Takashi Iwai <tiwai@xxxxxxxx>, Michael Peters <mpeters@xxxxxxxxxxxxxx>, Kris Bahnsen <kris@xxxxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-gpio@xxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx, linux-clk@xxxxxxxxxxxxxxx, linux-rtc@xxxxxxxxxxxxxxx, linux-watchdog@xxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-pwm@xxxxxxxxxxxxxxx, linux-spi@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, dmaengine@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, linux-ide@xxxxxxxxxxxxxxx, linux-input@xxxxxxxxxxxxxxx, alsa-devel@xxxxxxxxxxxxxxxx
- In-reply-to: <20230605-ep93xx-v3-22-3d63a5f1103e@maquefel.me>
- Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
- References: <20230605-ep93xx-v3-0-3d63a5f1103e@maquefel.me> <20230605-ep93xx-v3-22-3d63a5f1103e@maquefel.me>
On Thu, Jul 20, 2023 at 02:29:22PM +0300, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
>
> - drop subsys_initcall code
> - add OF ID match table with data
> - add of_probe for device tree
...
> +#include <linux/of_device.h>
Why?
...
> +#ifdef CONFIG_OF
Why this ugly ifdeffery?
...
> + data = of_device_get_match_data(&pdev->dev);
device_get_match_data()
> + if (!data)
> + return ERR_PTR(dev_err_probe(&pdev->dev, -ENODEV, "No device match found\n"));
...
> + edma = devm_kzalloc(&pdev->dev,
> + struct_size(edma, channels, data->num_channels),
> + GFP_KERNEL);
Something wrong with indentation. Not the first time, please check all your
patches for this kind of issues.
> + return ERR_PTR(-ENOMEM);
...
> + edmac->regs = devm_platform_ioremap_resource(pdev, i);
No check?
> + edmac->irq = platform_get_irq(pdev, i);
No check?
> + edmac->edma = edma;
> +
> + edmac->clk = of_clk_get(np, i);
> +
Redundant blank line.
Why one of devm_clk_get*() can't be called?
> + if (IS_ERR(edmac->clk)) {
> + dev_warn(&pdev->dev, "failed to get clock\n");
> + continue;
> + }
...
> + if (platform_get_device_id(pdev))
> + edma = ep93xx_init_from_pdata(pdev);
> + else
> + edma = ep93xx_dma_of_probe(pdev);
> +
Unneeded blank line.
> + if (!edma)
> + return PTR_ERR(edma);
...
> --- a/include/linux/platform_data/dma-ep93xx.h
> +++ b/include/linux/platform_data/dma-ep93xx.h
> #include <linux/types.h>
> #include <linux/dmaengine.h>
> #include <linux/dma-mapping.h>
> +#include <linux/of.h>
property.h.
...
> + if (of_device_is_compatible(dev_of_node(chan->device->dev), "cirrus,ep9301-dma-m2p"))
> + return true;
> +
device_is_compatible()
--
With Best Regards,
Andy Shevchenko
[Index of Archives]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|