[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <f8907616-0d6b-37ef-1419-f6aedf3ddbdc@samsung.com>
Date: Mon, 19 Sep 2016 12:44:07 +0200
From: Sylwester Nawrocki <s.nawrocki@...sung.com>
To: Sergio Prado <sergio.prado@...abworks.com>
Cc: dwmw2@...radead.org, computersforpeace@...il.com,
robh+dt@...nel.org, mark.rutland@....com, kgene@...nel.org,
k.kozlowski@...sung.com, boris.brezillon@...e-electrons.com,
richard@....at, linux-mtd@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH] mtd: s3c2410: add device tree support
On 09/17/2016 05:22 PM, Sergio Prado wrote:
> +static int s3c24xx_nand_probe_dt(struct platform_device *pdev)
> +{
> + const struct s3c24XX_nand_devtype_data *devtype_data;
> + struct s3c2410_platform_nand *pdata;
> + struct s3c2410_nand_info *info = platform_get_drvdata(pdev);
> + struct device_node *np = pdev->dev.of_node, *child;
> + const struct of_device_id *of_id;
> + struct s3c2410_nand_set *sets;
> +
> + of_id = of_match_device(s3c24xx_nand_dt_ids, &pdev->dev);
> + if (!of_id)
> + return 1;
> +
> + devtype_data = of_id->data;
You could make it a bit simpler with of_device_get_match_data().
--
Thanks,
Sylwester
Powered by blists - more mailing lists