All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd/physmap_of: Don't add disabled flash devices
@ 2011-08-16  9:25 Chunhe Lan
  2011-08-16 21:44 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Chunhe Lan @ 2011-08-16  9:25 UTC (permalink / raw)
  To: linux-mtd; +Cc: kumar.gala, linuxppc-dev, scottwood, akpm, dwmw2, Chunhe Lan

Flash(cfi-flash, jedec-flash, and so on) nodes with the
property status="disabled" are not usable and so avoid
adding "disabled" flash devices with the system.

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
---
 drivers/mtd/maps/physmap_of.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index d251d1d..812e6dc 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -219,6 +219,9 @@ static int __devinit of_flash_probe(struct platform_device *dev)
 	struct mtd_info **mtd_list = NULL;
 	resource_size_t res_size;
 
+	if (!of_device_is_available(dp))
+		return -ENODEV;
+
 	match = of_match_device(of_flash_match, &dev->dev);
 	if (!match)
 		return -EINVAL;
-- 
1.5.6.5

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

* Re: [PATCH] mtd/physmap_of: Don't add disabled flash devices
  2011-08-16  9:25 [PATCH] mtd/physmap_of: Don't add disabled flash devices Chunhe Lan
@ 2011-08-16 21:44 ` Scott Wood
  2011-08-22 10:02   ` Lan Chunhe
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2011-08-16 21:44 UTC (permalink / raw)
  To: Chunhe Lan; +Cc: dwmw2, kumar.gala, linux-mtd, akpm, linuxppc-dev

On 08/16/2011 04:25 AM, Chunhe Lan wrote:
> Flash(cfi-flash, jedec-flash, and so on) nodes with the
> property status="disabled" are not usable and so avoid
> adding "disabled" flash devices with the system.
> 
> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
> ---
>  drivers/mtd/maps/physmap_of.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
> index d251d1d..812e6dc 100644
> --- a/drivers/mtd/maps/physmap_of.c
> +++ b/drivers/mtd/maps/physmap_of.c
> @@ -219,6 +219,9 @@ static int __devinit of_flash_probe(struct platform_device *dev)
>  	struct mtd_info **mtd_list = NULL;
>  	resource_size_t res_size;
>  
> +	if (!of_device_is_available(dp))
> +		return -ENODEV;
> +
>  	match = of_match_device(of_flash_match, &dev->dev);
>  	if (!match)
>  		return -EINVAL;

Are you actually seeing unavailable devices get probed?  I thought the
upper layers were supposed to prevent that.

-Scott

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

* Re: [PATCH] mtd/physmap_of: Don't add disabled flash devices
  2011-08-16 21:44 ` Scott Wood
@ 2011-08-22 10:02   ` Lan Chunhe
  0 siblings, 0 replies; 3+ messages in thread
From: Lan Chunhe @ 2011-08-22 10:02 UTC (permalink / raw)
  To: Scott Wood, Chunhe Lan; +Cc: dwmw2, kumar.gala, linux-mtd, akpm, linuxppc-dev

On Wed, 17 Aug 2011 05:44:56 +0800, Scott Wood <scottwood@freescale.com>  
wrote:

> On 08/16/2011 04:25 AM, Chunhe Lan wrote:
>> Flash(cfi-flash, jedec-flash, and so on) nodes with the
>> property status="disabled" are not usable and so avoid
>> adding "disabled" flash devices with the system.
>>
>> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
>> ---
>>  drivers/mtd/maps/physmap_of.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mtd/maps/physmap_of.c  
>> b/drivers/mtd/maps/physmap_of.c
>> index d251d1d..812e6dc 100644
>> --- a/drivers/mtd/maps/physmap_of.c
>> +++ b/drivers/mtd/maps/physmap_of.c
>> @@ -219,6 +219,9 @@ static int __devinit of_flash_probe(struct  
>> platform_device *dev)
>>  	struct mtd_info **mtd_list = NULL;
>>  	resource_size_t res_size;
>>
>> +	if (!of_device_is_available(dp))
>> +		return -ENODEV;
>> +
>>  	match = of_match_device(of_flash_match, &dev->dev);
>>  	if (!match)
>>  		return -EINVAL;
>
> Are you actually seeing unavailable devices get probed?  I thought the
> upper layers were supposed to prevent that.

    You are right.
    The upper layers have prevented unavailable devices.
    So, this patch is no need.

    Thanks.

    -Jack Lan

> -Scott
 

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

end of thread, other threads:[~2011-08-22 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-16  9:25 [PATCH] mtd/physmap_of: Don't add disabled flash devices Chunhe Lan
2011-08-16 21:44 ` Scott Wood
2011-08-22 10:02   ` Lan Chunhe

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.