[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACna6rzO2h8Ohu1idnqw0j=Xi2o83x8oto=1ptBYW25GhmbAfg@mail.gmail.com>
Date: Thu, 21 May 2015 11:47:11 +0200
From: Rafał Miłecki <zajec5@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Brian Norris <computersforpeace@...il.com>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Stephen Warren <swarren@...dotorg.org>,
Marek Vasut <marex@...x.de>,
linux-spi <linux-spi@...r.kernel.org>
Subject: Re: [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor"
On 21 May 2015 at 11:39, Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> On Thu, May 21, 2015 at 11:31 AM, Rafał Miłecki <zajec5@...il.com> wrote:
>> On 21 May 2015 at 10:58, Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>>> On Thu, May 21, 2015 at 10:50 AM, Rafał Miłecki <zajec5@...il.com> wrote:
>>>>>>> I think your comments suggest that I shouldn't be removing "spi-nor"
>>>>>>> from m25p_ids[] nor from this block:
>>>>>>>
>>>>>>> if (data && data->type)
>>>>>>> flash_name = data->type;
>>>>>>> else if (!strcmp(spi->modalias, "spi-nor"))
>>>>>>> flash_name = NULL; /* auto-detect */
>>>>>>> else
>>>>>>> flash_name = spi->modalias;
>>>>>>>
>>>>>>> So it stays in both m25p_ids[] and .of_match_table.
>>>>>>>
>>>>>>> I suppose that can work. It then allows people to do weird stuff like:
>>>>>>>
>>>>>>> compatible = "idontknowwhatimdoing,spi-nor";
>>>>>>>
>>>>>>> in their device tree. But other than that, there's not much downside I don't
>>>>>>> think.
>>>>>>
>>>>>> It sounds like a reasonable solution. I guess there isn't a perfect
>>>>>> one. Even if we decide to go for sth like "jedec-spi-nor", there
>>>>>> always will be a chance of someone using
>>>>>> compatible = "idontknowwhatimdoing,jedec-spi-nor";
>>>>>> So if you rework your patch to leave "spi-nor" support in m25p_ids and
>>>>>> conditions block, it should be OK.
>>>>>
>>>>> Typically platform devices just use the driver's name. Hence IMHO there's
>>>>> no need to add a shiny new spi-nor device name.
>>>>>
>>>>> So what's wrong with using "m25p80", and treating that as auto-detect iff
>>>>> !spi->dev.of_node?
>>>>
>>>> Treating "m25p80" as auto-detect triggering string won't allow
>>>> platform to *force* "m25p80" flash type if there ever appears to be
>>>> needed. Maybe it's unlikely, but it still sounds like a bit bad design
>>>> for me.
>>>
>>> To force m25p80 flash, you set flash_platform_data.type to "m25p80"?
>>
>> Oh, I think I got lost in the way m25p80 is probed. Is it handled by
>> spi_board_info and its "modalias"?
>
> Indeed.
>
>> Could I leave flash_platform_data.type set to NULL and still have m25p80 probed?
>
> Yes, that case is the final "else" branch above.
Oh, I feel silly now. So I guess Brian's original patch was correct :|
--
Rafał
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists