linux-mips
[Top] [All Lists]

Re: [PATCH V7] MIPS: lantiq: add NOR flash support

To: dedekind1@gmail.com
Subject: Re: [PATCH V7] MIPS: lantiq: add NOR flash support
From: John Crispin <blogic@openwrt.org>
Date: Tue, 05 Apr 2011 14:57:41 +0200
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Ralph Hempel <ralph.hempel@lantiq.com>, linux-mtd@lists.infradead.org, Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>, David Woodhouse <dwmw2@infradead.org>
In-reply-to: <1302006995.2760.120.camel@localhost>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1302006830-10345-1-git-send-email-blogic@openwrt.org> <1302006995.2760.120.camel@localhost>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.7
>> +
>> +static int ltq_mtd_probing;
>>     
> ... I'm worried about this global variable. If you have multiple
> instances of such NOR flash, then you theoretically may have a situation
> when one of them is being probed, while another is being used for real.
> And this single global switch will break the one which is used for real.
>
> IOW, the right solution would be to have per-chip flag, not a global
> flag.
>
>   

Hi,

we could dynamically allocate the instance of struct map_info and then
use map_priv_1 to indicate whether the device is probing or not.

this would avoid using a global variable

John


<Prev in Thread] Current Thread [Next in Thread>