Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] mtd: hyperbus: Add proper error message for missing compatible
@ 2020-02-03  7:55 Dirk Behme
  2020-02-03 18:37 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Dirk Behme @ 2020-02-03  7:55 UTC (permalink / raw)
  To: sergei.shtylyov, vigneshr, linux-mtd; +Cc: dirk.behme

In case the compatible "cypress,hyperflash" is not given
output a proper error message. Do it the same way as some
lines above.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
---
 drivers/mtd/hyperbus/hyperbus-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/hyperbus/hyperbus-core.c b/drivers/mtd/hyperbus/hyperbus-core.c
index 6af9ea34117d..61b0f686a6dc 100644
--- a/drivers/mtd/hyperbus/hyperbus-core.c
+++ b/drivers/mtd/hyperbus/hyperbus-core.c
@@ -73,8 +73,10 @@ int hyperbus_register_device(struct hyperbus_device *hbdev)
 
 	np = hbdev->np;
 	ctlr = hbdev->ctlr;
-	if (!of_device_is_compatible(np, "cypress,hyperflash"))
+	if (!of_device_is_compatible(np, "cypress,hyperflash")) {
+		pr_err("hyperbus: 'cypress,hyperflash' compatible missing\n");
 		return -ENODEV;
+	}
 
 	hbdev->memtype = HYPERFLASH;
 
-- 
2.20.0


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: hyperbus: Add proper error message for missing compatible
  2020-02-03  7:55 [PATCH] mtd: hyperbus: Add proper error message for missing compatible Dirk Behme
@ 2020-02-03 18:37 ` Sergei Shtylyov
  2020-02-04  4:46   ` Vignesh Raghavendra
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2020-02-03 18:37 UTC (permalink / raw)
  To: Dirk Behme, vigneshr, linux-mtd

On 02/03/2020 10:55 AM, Dirk Behme wrote:

> In case the compatible "cypress,hyperflash" is not given
> output a proper error message. Do it the same way as some
> lines above.
> 
> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
> ---
>  drivers/mtd/hyperbus/hyperbus-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/hyperbus/hyperbus-core.c b/drivers/mtd/hyperbus/hyperbus-core.c
> index 6af9ea34117d..61b0f686a6dc 100644
> --- a/drivers/mtd/hyperbus/hyperbus-core.c
> +++ b/drivers/mtd/hyperbus/hyperbus-core.c
> @@ -73,8 +73,10 @@ int hyperbus_register_device(struct hyperbus_device *hbdev)
>  
>  	np = hbdev->np;
>  	ctlr = hbdev->ctlr;
> -	if (!of_device_is_compatible(np, "cypress,hyperflash"))
> +	if (!of_device_is_compatible(np, "cypress,hyperflash")) {
> +		pr_err("hyperbus: 'cypress,hyperflash' compatible missing\n");

   Traditionally, the string prop values are enclosed in "", not ''.

MBR, Sergei

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: hyperbus: Add proper error message for missing compatible
  2020-02-03 18:37 ` Sergei Shtylyov
@ 2020-02-04  4:46   ` Vignesh Raghavendra
  0 siblings, 0 replies; 3+ messages in thread
From: Vignesh Raghavendra @ 2020-02-04  4:46 UTC (permalink / raw)
  To: Sergei Shtylyov, Dirk Behme, linux-mtd

Hi,

On 04/02/20 12:07 am, Sergei Shtylyov wrote:
> On 02/03/2020 10:55 AM, Dirk Behme wrote:
> 
>> In case the compatible "cypress,hyperflash" is not given
>> output a proper error message. Do it the same way as some
>> lines above.
>>
>> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
>> ---
>>  drivers/mtd/hyperbus/hyperbus-core.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/hyperbus/hyperbus-core.c b/drivers/mtd/hyperbus/hyperbus-core.c
>> index 6af9ea34117d..61b0f686a6dc 100644
>> --- a/drivers/mtd/hyperbus/hyperbus-core.c
>> +++ b/drivers/mtd/hyperbus/hyperbus-core.c
>> @@ -73,8 +73,10 @@ int hyperbus_register_device(struct hyperbus_device *hbdev)
>>  
>>  	np = hbdev->np;
>>  	ctlr = hbdev->ctlr;
>> -	if (!of_device_is_compatible(np, "cypress,hyperflash"))
>> +	if (!of_device_is_compatible(np, "cypress,hyperflash")) {
>> +		pr_err("hyperbus: 'cypress,hyperflash' compatible missing\n");
> 
>    Traditionally, the string prop values are enclosed in "", not ''.
> 

Also, please use dev_err() here. ctlr->dev should have a valid device
pointer at this point.


-- 
Regards
Vignesh

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03  7:55 [PATCH] mtd: hyperbus: Add proper error message for missing compatible Dirk Behme
2020-02-03 18:37 ` Sergei Shtylyov
2020-02-04  4:46   ` Vignesh Raghavendra

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git