From patchwork Thu Mar 10 23:56:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franklin Cooper X-Patchwork-Id: 8560831 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E370F9F38C for ; Thu, 10 Mar 2016 23:59:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20B332037E for ; Thu, 10 Mar 2016 23:59:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E9C420376 for ; Thu, 10 Mar 2016 23:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933284AbcCJX7J (ORCPT ); Thu, 10 Mar 2016 18:59:09 -0500 Received: from mail-ob0-f194.google.com ([209.85.214.194]:36194 "EHLO mail-ob0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933198AbcCJX4w (ORCPT ); Thu, 10 Mar 2016 18:56:52 -0500 Received: by mail-ob0-f194.google.com with SMTP id cf7so7558908obc.3; Thu, 10 Mar 2016 15:56:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/hGtX2Hh0E4GObUF8lnNNIO5iqwUm/BAG7HxjrYJ7n0=; b=bHDUhUmTr8FqVsmxaJM6+wTkYem88mTk8c18JE1zmSyXb5KnchcJmazcY++WAoI2fR B4Oav1NmAEmXV/M9yAvZlhcHT/7x5JWJdeMbnu5nov0TkdQDVidX+7eUcVSZmW0x+O1T +SvyKBler40qQY3qTJ2bvSnIh8oLVE+vcbxp3nIyA63OPOv2Ad92BqyC1t6HjjdtvvtQ 62nEJYeDVCZb57HDOhtYs7JnkdtIFa38po8/pxbM8dI0IbbQTXlIy9Jq1wXFblWduTCf K2bhPFbB6KsnYmXyyAIloLFfP4HJ1iuza4rfoZqDWEZqRGPqq1GzqL/JRweh42l5YpGF vmKQ== X-Gm-Message-State: AD7BkJLPEqcFFRadV5ywffT7vY903heENIj8UcHUwrzS4xcHPgS9lSdKfWry3ZZ2jR2HFw== X-Received: by 10.60.150.235 with SMTP id ul11mr3721740oeb.70.1457654211286; Thu, 10 Mar 2016 15:56:51 -0800 (PST) Received: from beast-server.fios-router.home (pool-173-57-21-86.dllstx.fios.verizon.net. [173.57.21.86]) by smtp.gmail.com with ESMTPSA id d1sm2907073oby.16.2016.03.10.15.56.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Mar 2016 15:56:50 -0800 (PST) From: Franklin S Cooper Jr To: nsekhar@ti.com, dwmw2@infradead.org, computersforpeace@gmail.com, rogerq@ti.com, tony@atomide.com, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Franklin S Cooper Jr Subject: [PATCH v4 1/7] ARM: OMAP2+: gpmc-nand: Set omap2-nand's parent dev to GPMC dev Date: Thu, 10 Mar 2016 17:56:37 -0600 Message-Id: <1457654203-20856-2-git-send-email-fcooper@ti.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457654203-20856-1-git-send-email-fcooper@ti.com> References: <1457654203-20856-1-git-send-email-fcooper@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dma channel information is located within the GPMC node which is the NAND's parent node. The NAND driver requires a handle to the GPMC's dev to properly parse the DMA properties. Therefore, set the NAND's parent dev to the GPMC's dev so it can be referenced within the driver. Signed-off-by: Franklin S Cooper Jr --- Version 4 changes: Instead of storing the GPMC dev in a new property simply grab a reference to it and set omap2-nand's dev.parent to it. arch/arm/mach-omap2/gpmc-nand.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 72918c4..77e453c 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -77,6 +78,9 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, int err = 0; struct gpmc_settings s; struct platform_device *pdev; + struct platform_device *gpmc_dev; + struct device_node *gpmc_node; + struct resource gpmc_nand_res[] = { { .flags = IORESOURCE_MEM, }, { .flags = IORESOURCE_IRQ, }, @@ -134,8 +138,18 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, if (pdev) { err = platform_device_add_resources(pdev, gpmc_nand_res, ARRAY_SIZE(gpmc_nand_res)); - if (!err) + if (!err) { pdev->dev.platform_data = gpmc_nand_data; + + gpmc_node = of_get_parent(gpmc_nand_data->of_node); + + if (gpmc_node) { + gpmc_dev = of_find_device_by_node(gpmc_node); + + if (gpmc_dev) + pdev->dev.parent = &gpmc_dev->dev; + } + } } else { err = -ENOMEM; }