mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vignesh R <vigneshr@ti.com>
To: Boris Brezillon <bbrezillon@kernel.org>
Cc: "Tudor.Ambarus@microchip.com" <Tudor.Ambarus@microchip.com>,
	"marek.vasut@gmail.com" <marek.vasut@gmail.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 2/2] mtd: spi-nor: cadence-quadspi: Add support for Octal SPI controller
Date: Mon, 11 Feb 2019 10:23:42 +0530	[thread overview]
Message-ID: <fd245dc9-6d3c-8075-a684-d4fe6cb85849@ti.com> (raw)
In-Reply-To: <20190210141912.1da19db6@kernel.org>



On 10/02/19 6:49 PM, Boris Brezillon wrote:
> On Tue, 5 Feb 2019 11:43:46 +0530
> Vignesh R <vigneshr@ti.com> wrote:
> 
>>>>  static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np)
>>>>  {
>>>> -	const struct spi_nor_hwcaps hwcaps = {
>>>> -		.mask = SNOR_HWCAPS_READ |
>>>> -			SNOR_HWCAPS_READ_FAST |
>>>> -			SNOR_HWCAPS_READ_1_1_2 |
>>>> -			SNOR_HWCAPS_READ_1_1_4 |
>>>> -			SNOR_HWCAPS_PP,
>>>> -	};
>>>>  	struct platform_device *pdev = cqspi->pdev;
>>>>  	struct device *dev = &pdev->dev;
>>>> +	const struct cqspi_driver_platdata *ddata;
>>>> +	struct spi_nor_hwcaps hwcaps;
>>>>  	struct cqspi_flash_pdata *f_pdata;
>>>>  	struct spi_nor *nor;
>>>>  	struct mtd_info *mtd;
>>>>  	unsigned int cs;
>>>>  	int i, ret;
>>>>  
>>>> +	ddata = of_device_get_match_data(dev);
>>>> +	if (!ddata)
>>>> +		hwcaps.mask = CQSPI_BASE_HWCAPS_MASK;  
>>>
>>> Now that .data is set in all cqspi_dt_ids[], maybe it's better to print a
>>> message and return an error here. But I guess it's a matter of taste, so not a
>>> show stopper.  
>>
>> Since, driver data is kernel internal field, I guess there is little
>> help in printing out the error to the user when its missing. I prefer to
>> keep this as is, as basic Quad mode is supported by all versions of the IP.
> 
> Well, if all compat entries have an associated platdata instance we
> don't need to support the !ddata case, right? I think enforcing the
> presence of such a platdata is actually is a sane thing to do (which
> implies returning an error when ddata is NULL).
> 

Ok, will respin with a dev_err() and return -EINVAL when ddata is NULL.

-- 
Regards
Vignesh

      reply	other threads:[~2019-02-11  4:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28  5:49 [PATCH v5 0/2] cadence-quadspi: Add Octal mode support Vignesh R
2019-01-28  5:49 ` [PATCH v5 1/2] dt-bindings: cadence-quadspi: Add new compatible for AM654 SoC Vignesh R
2019-01-28  5:49 ` [PATCH v5 2/2] mtd: spi-nor: cadence-quadspi: Add support for Octal SPI controller Vignesh R
2019-01-29 15:32   ` Tudor.Ambarus
2019-02-05  6:13     ` Vignesh R
2019-02-10 13:19       ` Boris Brezillon
2019-02-11  4:53         ` Vignesh R [this message]

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=fd245dc9-6d3c-8075-a684-d4fe6cb85849@ti.com \
    --to=vigneshr@ti.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=bbrezillon@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=robh+dt@kernel.org \
    /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

all inboxes | Powered by JetHome®