From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Murali Nalajala <mnalajal@codeaurora.org>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
linux-arm-msm@vger.kernel.org,
"Arve Hjønnevåg" <arve@android.com>,
linux-arm-kernel@lists.infradead.org, swetland@google.com
Subject: Re: [PATCH 1/1] mtd: msm_nand: Add initial msm nand driver support.
Date: Thu, 6 Jan 2011 15:48:52 +0000 [thread overview]
Message-ID: <20110106154852.GG31708@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1293785680-19850-1-git-send-email-mnalajal@codeaurora.org>
On Fri, Dec 31, 2010 at 02:24:40PM +0530, Murali Nalajala wrote:
> + info->msm_nand.dev = &pdev->dev;
> +
> + init_waitqueue_head(&info->msm_nand.wait_queue);
> +
> + info->msm_nand.dma_channel = res->start;
> + pr_debug("dma channel 0x%x\n", info->msm_nand.dma_channel);
> + info->msm_nand.dma_buffer =
> + dma_alloc_coherent(NULL, MSM_NAND_DMA_BUFFER_SIZE,
> + &info->msm_nand.dma_addr, GFP_KERNEL);
Haven't you got a struct device for this (&pdev->dev) ?
> + if (info->msm_nand.dma_buffer == NULL) {
> + err = -ENOMEM;
> + goto out_free_info;
> + }
> +
> + pr_debug("allocated dma buffer at %p, dma_addr %x\n",
> + info->msm_nand.dma_buffer, info->msm_nand.dma_addr);
> +
> + info->mtd.name = dev_name(&pdev->dev);
> + info->mtd.priv = &info->msm_nand;
> + info->mtd.owner = THIS_MODULE;
> +
> + if (msm_nand_scan(&info->mtd, 1)) {
> + err = -ENXIO;
> + goto out_free_dma_buffer;
> + }
> +
> +#ifdef CONFIG_MTD_PARTITIONS
> + err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
> + if (err > 0)
> + err = add_mtd_partitions(&info->mtd, info->parts, err);
> + else if (err <= 0 && pdata && pdata->parts)
> + err = add_mtd_partitions(&info->mtd, pdata->parts,
> + pdata->nr_parts);
> + else
> +#endif
> + err = add_mtd_device(&info->mtd);
> +
> + if (err != 0)
> + goto out_free_dma_buffer;
> +
> + platform_set_drvdata(pdev, info);
> +
> + return 0;
> +
> +out_free_dma_buffer:
> + dma_free_coherent(NULL, MSM_NAND_DMA_BUFFER_SIZE,
Ditto.
> + info->msm_nand.dma_buffer, info->msm_nand.dma_addr);
> +out_free_info:
> + kfree(info);
> +
> + return err;
> +}
> +
> +static int __devexit msm_nand_remove(struct platform_device *pdev)
> +{
> + struct msm_nand_info *info = platform_get_drvdata(pdev);
> +
> + platform_set_drvdata(pdev, NULL);
> +
> +#ifdef CONFIG_MTD_PARTITIONS
> + if (info->parts)
> + del_mtd_partitions(&info->mtd);
> + else
> +#endif
> + del_mtd_device(&info->mtd);
> +
> + msm_nand_release(&info->mtd);
> + dma_free_coherent(NULL, MSM_NAND_DMA_BUFFER_SIZE,
Ditto.
next prev parent reply other threads:[~2011-01-06 15:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-31 8:54 [PATCH 1/1] mtd: msm_nand: Add initial msm nand driver support Murali Nalajala
2010-12-31 8:54 ` Murali Nalajala
2011-01-05 8:41 ` Artem Bityutskiy
2011-01-05 17:12 ` Daniel Walker
2011-01-05 20:39 ` Artem Bityutskiy
2011-01-06 17:39 ` Daniel Walker
2011-01-06 18:49 ` Artem Bityutskiy
2011-01-06 15:33 ` David Woodhouse
2011-01-06 15:48 ` Russell King - ARM Linux [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-01-05 6:48 Murali Nalajala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110106154852.GG31708@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=arve@android.com \
--cc=dwmw2@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mnalajal@codeaurora.org \
--cc=swetland@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).