From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521AbcITCcB (ORCPT ); Mon, 19 Sep 2016 22:32:01 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:34466 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbcITCb7 (ORCPT ); Mon, 19 Sep 2016 22:31:59 -0400 Date: Mon, 19 Sep 2016 23:31:49 -0300 From: Sergio Prado To: Sylwester Nawrocki Cc: dwmw2@infradead.org, computersforpeace@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, kgene@kernel.org, k.kozlowski@samsung.com, boris.brezillon@free-electrons.com, richard@nod.at, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: Re: [PATCH] mtd: s3c2410: add device tree support Message-ID: <20160920023149.GC11294@n1> References: <1474125760-28168-1-git-send-email-sergio.prado@e-labworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 19, 2016 at 12:44:07PM +0200, Sylwester Nawrocki wrote: > 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(). I wasn't aware of this interface. I'll use it. Thanks! > > -- > Thanks, > Sylwester -- Sergio Prado Embedded Labworks Office: +55 11 2628-3461 Mobile: +55 11 97123-3420