mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Sinan Akman <sinan@writeme.com>
Cc: linux-kernel@vger.kernel.org, avorontsov@ru.mvista.com,
	dbrownell@users.sourceforge.net
Subject: Re: [PATCH] spi: Add OF-style registration and binding
Date: Wed, 29 Sep 2010 17:14:26 +0900	[thread overview]
Message-ID: <20100929081426.GA4703@angua.secretlab.ca> (raw)
In-Reply-To: <1285706848-9281-1-git-send-email-sinan@writeme.com>

On Tue, Sep 28, 2010 at 04:47:28PM -0400, Sinan Akman wrote:
> This patch adds the OF hook to the spi core so that devices
> can automatically be registered based on device tree data.
> 
> Signed-off-by: Sinan Akman <sinan@writeme.com>

Applied to -merge, thanks.

g.

> ---
>  drivers/spi/spi.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 0bcf4c1..b5a78a1 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -23,6 +23,7 @@
>  #include <linux/init.h>
>  #include <linux/cache.h>
>  #include <linux/mutex.h>
> +#include <linux/of_device.h>
>  #include <linux/slab.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/spi/spi.h>
> @@ -86,6 +87,10 @@ 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;
> +
>  	if (sdrv->id_table)
>  		return !!spi_match_id(sdrv->id_table, spi);
>  
> -- 
> 1.6.2.5
> 

      reply	other threads:[~2010-09-29  8:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 20:47 Sinan Akman
2010-09-29  8:14 ` Grant Likely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100929081426.GA4703@angua.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=avorontsov@ru.mvista.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sinan@writeme.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome