devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhou Wang <wangzhou.bry@gmail.com>
To: Frans Klaver <fransklaver@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	linux-mtd@lists.infradead.org,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	haojian.zhuang@gmail.com, wangzhou1@hisilicon.com,
	Rob Herring <robh+dt@kernel.org>,
	xuwei5@hisilicon.com, Kumar Gala <galak@codeaurora.org>,
	caizhiyong@huawei.com
Subject: Re: [PATCH v3 1/2] mtd: hisilicon: add a new NAND controller driver for hisilicon hip04 Soc
Date: Thu, 30 Oct 2014 10:28:25 +0800	[thread overview]
Message-ID: <5451A249.3040909@gmail.com> (raw)
In-Reply-To: <CAH6sp9MuL+AAvMi1VrmOhq5Y-ri2DKO3g0h1hw040h5=CRu6UQ@mail.gmail.com>

On 2014年10月28日 22:22, Frans Klaver wrote:
> On Tue, Oct 28, 2014 at 11:53 AM, Zhou Wang <wangzhou.bry@gmail.com> wrote:
>> +
>> +static int hisi_nfc_probe(struct platform_device *pdev)
>> +{
>> +       int ret = 0, irq, buswidth, flag, max_chips = HINFC504_MAX_CHIP;
>> +       struct device *dev = &pdev->dev;
>> +       struct hinfc_host *host;
>> +       struct nand_chip  *chip;
>> +       struct mtd_info   *mtd;
>> +       struct resource   *res;
>> +       struct device_node *np = dev->of_node;
>> +       struct mtd_part_parser_data ppdata;
>> +
>> +       host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
>> +       if (!host)
>> +               return -ENOMEM;
>> +       host->dev = dev;
>> +
>> +       platform_set_drvdata(pdev, host);
>> +       chip = &host->chip;
>> +       mtd  = &host->mtd;
>> +
>> +       irq = platform_get_irq(pdev, 0);
>> +       if (irq < 0) {
>> +               dev_err(dev, "no IRQ resource defined\n");
>> +               ret = -ENXIO;
>> +               goto err_res;
>> +       }
>> +
>> +       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +       host->iobase = devm_ioremap_resource(dev, res);
>> +       if (IS_ERR(host->iobase)) {
>> +               ret = PTR_ERR(host->iobase);
>> +               dev_err(dev, "devm_ioremap_resource[0] fail\n");
>> +               goto err_res;
>> +       }
>> +
>> +       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>> +       chip->IO_ADDR_R = chip->IO_ADDR_W = devm_ioremap_resource(dev, res);
>> +       if (IS_ERR(chip->IO_ADDR_R)) {
>> +               ret = PTR_ERR(chip->IO_ADDR_R);
>> +               dev_err(dev, "devm_ioremap_resource[1] fail\n");
>> +               goto err_res;
>> +       }
>> +
>> +       mtd->priv               = chip;
>> +       mtd->owner              = THIS_MODULE;
>> +       mtd->name               = "hisi_nand";
>
> + mtd->dev.parent = &pdev->dev;
>
> This is a bug that lives in a bunch of other nand drivers as well.
> add_mtd_device (called by mtd_device_parse_register()) expects
> dev.parent to be set for properly adding a device reference to the
> sysfs node.
>
> Frans
>
My mistake, I will add this line. Thanks a lot for your reminding.

Kind regards,
Zhou Wang

  reply	other threads:[~2014-10-30  2:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28 10:53 [PATCH v3 0/2] mtd: hisilicon: add a new driver for NAND controller of hisilicon hip04 Soc Zhou Wang
2014-10-28 10:53 ` [PATCH v3 1/2] mtd: hisilicon: add a new NAND controller driver for " Zhou Wang
2014-10-28 14:22   ` Frans Klaver
2014-10-30  2:28     ` Zhou Wang [this message]
2014-10-28 10:53 ` [PATCH v3 2/2] mtd: hisilicon: add device tree binding documentation Zhou Wang

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=5451A249.3040909@gmail.com \
    --to=wangzhou.bry@gmail.com \
    --cc=caizhiyong@huawei.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=fransklaver@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=xuwei5@hisilicon.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).