Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754385AbbERSe7 (ORCPT ); Mon, 18 May 2015 14:34:59 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34718 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754295AbbERSez (ORCPT ); Mon, 18 May 2015 14:34:55 -0400 Date: Mon, 18 May 2015 11:34:42 -0700 From: Brian Norris To: Mark Rutland Cc: Rob Herring , Pawel Moll , Ian Campbell , Kumar Gala , "linux-mtd@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Stephen Warren , Geert Uytterhoeven , Marek Vasut , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-spi@vger.kernel.org Subject: Re: [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" Message-ID: <20150518183442.GR11598@ld-irv-0074> References: <1431624773-4165-1-git-send-email-computersforpeace@gmail.com> <20150515195541.GL11598@ld-irv-0074> <20150518104501.GD3551@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150518104501.GD3551@leverpostej> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1943 Lines: 57 + linux-spi On Mon, May 18, 2015 at 11:45:01AM +0100, Mark Rutland wrote: > On Fri, May 15, 2015 at 08:55:41PM +0100, Brian Norris wrote: > > It really helps if I test patches... > > > > On Thu, May 14, 2015 at 10:32:53AM -0700, Brian Norris wrote: [...] > > > @@ -305,7 +305,7 @@ static const struct spi_device_id m25p_ids[] = { > > > * Generic support for SPI NOR that can be identified by the JEDEC READ > > > * ID opcode (0x9F). Use this, if possible. > > > */ > > > - {"nor-jedec"}, > > > + {"jedec,spi-nor"}, > > > > So I forgot (again; we hit this before) that the SPI/OF framework strips > > everything before the first comma before binding devices. See > > of_modalias_node(). So I'll have to squash in the patch below to get a > > usable binding. > > Is it not possible to use the of_match_table on spi_driver::driver? If > not, we really should make it so. Hmm, it does look like spi.c supports multiple matching mechanisms, so I guess m25p80.c could match some with of_match_table and some with modalias/spi_driver.id_table. See: static int spi_match_device(struct device *dev, struct device_driver *drv) { const struct spi_device *spi = to_spi_device(dev); const struct spi_driver *sdrv = to_spi_driver(drv); /* Attempt an OF style match */ if (of_driver_match_device(dev, drv)) return 1; // ^^^^ we aren't yet (but could be) using this /* Then try ACPI */ if (acpi_driver_match_device(dev, drv)) return 1; if (sdrv->id_table) return !!spi_match_id(sdrv->id_table, spi); // ^^^^ we're currently only using this return strcmp(spi->modalias, drv->name) == 0; } I'll see about patching this for 4.2. We have a working solution for 4.1 at least. Brian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/