lkml.org 
[lkml]   [2022]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/3] SPI: Ingenic: Add SFC support for Ingenic SoCs.
From
Le 22/07/2022 à 18:48, 周琰杰 (Zhou Yanjie) a écrit :
> Add SFC support for the X1000 SoC, the X1600 SoC, and the X2000 SoC
> from Ingenic.
>
> Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
> ---
> drivers/spi/Kconfig | 9 +
> drivers/spi/Makefile | 1 +
> drivers/spi/spi-ingenic-sfc.c | 662 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 672 insertions(+)
> create mode 100644 drivers/spi/spi-ingenic-sfc.c
>

[...]

> +static int ingenic_sfc_probe(struct platform_device *pdev)
> +{
> + struct ingenic_sfc *sfc;
> + struct spi_controller *ctlr;
> + int ret;
> +
> + ctlr = spi_alloc_master(&pdev->dev, sizeof(*sfc));
> + if (!ctlr)
> + return -ENOMEM;

devm_spi_alloc_master()? (+ error handling simplification)
Or there should be a .remove() function.

CJ

> +
> + sfc = spi_controller_get_devdata(ctlr);
> +
> + sfc->soc_info = of_device_get_match_data(&pdev->dev);
> + if (!sfc->soc_info) {
> + dev_err(&pdev->dev, "No of match data provided\n");
> + ret = -ENODEV;
> + goto err_put_master;
> + }
> +

[...]

\
 
 \ /
  Last update: 2022-07-23 17:18    [W:0.222 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site