All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karl Beldan <karl.beldan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Greg Ungerer <gerg-JBU5SbJe1FlAfugRpC6u6w@public.gmane.org>
Cc: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [v3] spi: orion: support armada extended baud rates
Date: Wed, 15 Oct 2014 15:10:54 +0200	[thread overview]
Message-ID: <20141015131054.GA3243@gobelin> (raw)
In-Reply-To: <543C8460.1060508-JBU5SbJe1FlAfugRpC6u6w@public.gmane.org>

On Tue, Oct 14, 2014 at 12:03:12PM +1000, Greg Ungerer wrote:
> Hi Karl,
> 
> On 12/10/14 00:52, Karl Beldan wrote:
> > On 28/09/14 23:24:04, Greg Ungerer wrote:
> >> @@ -378,6 +452,10 @@ static int orion_spi_probe(struct platform_device *pdev)
> >>  	spi = spi_master_get_devdata(master);
> >>  	spi->master = master;
> >>  
> >> +	of_id = of_match_device(orion_spi_of_match_table, &pdev->dev);
> >> +	devdata = of_id->data;
> >> +	spi->devdata = devdata;
> >> +
> > Won't of_match_device return NULL on non-DT systems, and further
> > references oops ?
> 
> Yes, sure enough.
> 
> So I propose to fix with this change.
> 
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index acf8e48..c069ccd 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -453,7 +453,7 @@ static int orion_spi_probe(struct platform_device *pdev)
>         spi->master = master;
>  
>         of_id = of_match_device(orion_spi_of_match_table, &pdev->dev);
> -       devdata = of_id->data;
> +       devdata = (of_id) ? of_id->data : &orion_spi_dev_data;
>         spi->devdata = devdata;
>  
I am not aware of the policy in the DT subsystem, I see some drivers
bailing out when not getting any match, some remove non-DT support and
add a dependency on OF, yet a message would feel appropriate.
Other than that ok, it should fix df59fa7f4bca.
 
Karl
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-10-15 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-28 13:24 [PATCH v3] spi: orion: support armada extended baud rates gerg-JBU5SbJe1FlAfugRpC6u6w
     [not found] ` <1411910644-7174-1-git-send-email-gerg-JBU5SbJe1FlAfugRpC6u6w@public.gmane.org>
2014-10-01 18:22   ` Mark Brown
2014-10-11 14:52   ` [v3] " Karl Beldan
2014-10-13 12:48     ` Mark Brown
2014-10-14  2:03     ` Greg Ungerer
     [not found]       ` <543C8460.1060508-JBU5SbJe1FlAfugRpC6u6w@public.gmane.org>
2014-10-15 13:10         ` Karl Beldan [this message]
2014-10-17  4:53           ` Greg Ungerer

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=20141015131054.GA3243@gobelin \
    --to=karl.beldan-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gerg-JBU5SbJe1FlAfugRpC6u6w@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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 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.