All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: "Ramuthevar,
	Vadivel MuruganX"  <vadivel.muruganx.ramuthevar@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	devicetree@vger.kernel.org, cheol.yong.kim@intel.com,
	hauke.mehrtens@intel.com, qi-ming.wu@intel.com,
	anders.roxell@linaro.org, vigneshr@ti.com, arnd@arndb.de,
	richard@nod.at, brendanhiggins@google.com,
	linux-mips@vger.kernel.org, robh+dt@kernel.org,
	tglx@linutronix.de, masonccyang@mxic.com.tw,
	andriy.shevchenko@intel.com
Subject: Re: [PATCH v3 2/2] mtd: rawnand: Add NAND controller support on Intel LGM SoC
Date: Mon, 27 Apr 2020 17:51:27 +0200	[thread overview]
Message-ID: <20200427175127.0518c193@xps13> (raw)
In-Reply-To: <20200424183612.4cfdbb6a@collabora.com>

Hi Ramuthevar,

> > +static int ebu_nand_probe(struct platform_device *pdev)
> > +{
> > +	struct device *dev = &pdev->dev;
> > +	struct ebu_nand_controller *ebu_host;
> > +	struct nand_chip *nand;
> > +	phys_addr_t nandaddr_pa;
> > +	struct mtd_info *mtd;
> > +	struct resource *res;
> > +	int ret;
> > +	u32 cs;
> > +
> > +	ebu_host = devm_kzalloc(dev, sizeof(*ebu_host), GFP_KERNEL);
> > +	if (!ebu_host)
> > +		return -ENOMEM;
> > +
> > +	ebu_host->dev = dev;
> > +	nand_controller_init(&ebu_host->controller);
> > +
> > +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ebunand");
> > +	ebu_host->ebu_addr = devm_ioremap_resource(&pdev->dev, res);
> > +	if (IS_ERR(ebu_host->ebu_addr))
> > +		return PTR_ERR(ebu_host->ebu_addr);
> > +
> > +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hsnand");
> > +	ebu_host->nand_addr = devm_ioremap_resource(&pdev->dev, res);
> > +	if (IS_ERR(ebu_host->nand_addr))
> > +		return PTR_ERR(ebu_host->nand_addr);
> > +
> > +	ret = device_property_read_u32(dev, "nand,cs", &cs);  
> 
> CS ids should be encoded in the reg property (see [1]).

Is it your choice to only support a single CS or is it actually a
controller limitation? If the latter, it would be much better I think
to anticipate the addition of the support for another CS. And in
this case there are many places in this driver that should be
more generic.

> > +	if (ret) {
> > +		dev_err(dev, "failed to get chip select: %d\n", ret);
> > +		return ret;
> > +	}
> > +
> > +	ebu_host->cs = cs;
> > +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cs0");  

Thanks,
Miquèl

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: cheol.yong.kim@intel.com, hauke.mehrtens@intel.com,
	masonccyang@mxic.com.tw, anders.roxell@linaro.org,
	vigneshr@ti.com, arnd@arndb.de, devicetree@vger.kernel.org,
	richard@nod.at, brendanhiggins@google.com,
	linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
	"Ramuthevar,
	Vadivel MuruganX" <vadivel.muruganx.ramuthevar@linux.intel.com>,
	robh+dt@kernel.org, linux-mtd@lists.infradead.org,
	tglx@linutronix.de, qi-ming.wu@intel.com,
	andriy.shevchenko@intel.com
Subject: Re: [PATCH v3 2/2] mtd: rawnand: Add NAND controller support on Intel LGM SoC
Date: Mon, 27 Apr 2020 17:51:27 +0200	[thread overview]
Message-ID: <20200427175127.0518c193@xps13> (raw)
In-Reply-To: <20200424183612.4cfdbb6a@collabora.com>

Hi Ramuthevar,

> > +static int ebu_nand_probe(struct platform_device *pdev)
> > +{
> > +	struct device *dev = &pdev->dev;
> > +	struct ebu_nand_controller *ebu_host;
> > +	struct nand_chip *nand;
> > +	phys_addr_t nandaddr_pa;
> > +	struct mtd_info *mtd;
> > +	struct resource *res;
> > +	int ret;
> > +	u32 cs;
> > +
> > +	ebu_host = devm_kzalloc(dev, sizeof(*ebu_host), GFP_KERNEL);
> > +	if (!ebu_host)
> > +		return -ENOMEM;
> > +
> > +	ebu_host->dev = dev;
> > +	nand_controller_init(&ebu_host->controller);
> > +
> > +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ebunand");
> > +	ebu_host->ebu_addr = devm_ioremap_resource(&pdev->dev, res);
> > +	if (IS_ERR(ebu_host->ebu_addr))
> > +		return PTR_ERR(ebu_host->ebu_addr);
> > +
> > +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hsnand");
> > +	ebu_host->nand_addr = devm_ioremap_resource(&pdev->dev, res);
> > +	if (IS_ERR(ebu_host->nand_addr))
> > +		return PTR_ERR(ebu_host->nand_addr);
> > +
> > +	ret = device_property_read_u32(dev, "nand,cs", &cs);  
> 
> CS ids should be encoded in the reg property (see [1]).

Is it your choice to only support a single CS or is it actually a
controller limitation? If the latter, it would be much better I think
to anticipate the addition of the support for another CS. And in
this case there are many places in this driver that should be
more generic.

> > +	if (ret) {
> > +		dev_err(dev, "failed to get chip select: %d\n", ret);
> > +		return ret;
> > +	}
> > +
> > +	ebu_host->cs = cs;
> > +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cs0");  

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2020-04-27 15:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 16:21 [PATCH v3 0/2] mtd: rawnand: Add NAND controller support on Intel LGM SoC Ramuthevar,Vadivel MuruganX
2020-04-23 16:21 ` Ramuthevar, Vadivel MuruganX
2020-04-23 16:21 ` [PATCH v3 1/2] dt-bindings: mtd: Add YAML for Nand Flash Controller support Ramuthevar,Vadivel MuruganX
2020-04-23 16:21   ` Ramuthevar, Vadivel MuruganX
2020-04-29 11:50   ` Maxime Ripard
2020-04-29 11:50     ` Maxime Ripard
2020-04-23 16:21 ` [PATCH v3 2/2] mtd: rawnand: Add NAND controller support on Intel LGM SoC Ramuthevar,Vadivel MuruganX
2020-04-23 16:21   ` Ramuthevar, Vadivel MuruganX
2020-04-24 16:36   ` Boris Brezillon
2020-04-24 16:36     ` Boris Brezillon
2020-04-27  4:17     ` Ramuthevar, Vadivel MuruganX
2020-04-27  4:17       ` Ramuthevar, Vadivel MuruganX
2020-04-27 15:51     ` Miquel Raynal [this message]
2020-04-27 15:51       ` Miquel Raynal
2020-04-28  6:17       ` Ramuthevar, Vadivel MuruganX
2020-04-28  6:17         ` Ramuthevar, Vadivel MuruganX
2020-04-28  6:27         ` Boris Brezillon
2020-04-28  6:27           ` Boris Brezillon
2020-04-28  6:40           ` Ramuthevar, Vadivel MuruganX
2020-04-28  6:40             ` Ramuthevar, Vadivel MuruganX
2020-04-28  6:47             ` Boris Brezillon
2020-04-28  6:47               ` Boris Brezillon
2020-04-28  6:50               ` Ramuthevar, Vadivel MuruganX
2020-04-28  6:50                 ` Ramuthevar, Vadivel MuruganX
2020-04-28  7:40                 ` Miquel Raynal
2020-04-28  7:40                   ` Miquel Raynal
2020-04-28  7:50                   ` Ramuthevar, Vadivel MuruganX
2020-04-28  7:50                     ` Ramuthevar, Vadivel MuruganX
2020-04-28  7:54                     ` Miquel Raynal
2020-04-28  7:54                       ` Miquel Raynal
2020-04-28  8:28                       ` Ramuthevar, Vadivel MuruganX
2020-04-28  8:28                         ` Ramuthevar, Vadivel MuruganX
2020-04-28  8:41                       ` Ramuthevar, Vadivel MuruganX
2020-04-28  8:41                         ` Ramuthevar, Vadivel MuruganX

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=20200427175127.0518c193@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=anders.roxell@linaro.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=arnd@arndb.de \
    --cc=boris.brezillon@collabora.com \
    --cc=brendanhiggins@google.com \
    --cc=cheol.yong.kim@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hauke.mehrtens@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=masonccyang@mxic.com.tw \
    --cc=qi-ming.wu@intel.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vadivel.muruganx.ramuthevar@linux.intel.com \
    --cc=vigneshr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.