mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] spi: i.MX: Fix wrong bus nubering with devicetree
Date: Fri, 14 Dec 2018 15:08:51 +0100	[thread overview]
Message-ID: <20181214140851.5r72avd74etxydzh@pengutronix.de> (raw)
In-Reply-To: <20181213080144.8401-1-shc_work@mail.ru>

On Thu, Dec 13, 2018 at 11:01:43AM +0300, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> 

Applied, thanks

Sascha

> diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
> index 10621d00c..46e8955ab 100644
> --- a/drivers/spi/imx_spi.c
> +++ b/drivers/spi/imx_spi.c
> @@ -605,17 +605,20 @@ static int imx_spi_probe(struct device_d *dev)
>  
>  	master = &imx->master;
>  	master->dev = dev;
> -	master->bus_num = dev->id;
>  
>  	master->setup = imx_spi_setup;
>  	master->transfer = imx_spi_transfer;
>  
>  	if (pdata) {
> +		master->bus_num = dev->id;
>  		master->num_chipselect = pdata->num_chipselect;
>  		imx->cs_array = pdata->chipselect;
> -	} else {
> -		if (IS_ENABLED(CONFIG_OFDEVICE))
> -			imx_spi_dt_probe(imx);
> +	} else if (IS_ENABLED(CONFIG_OFDEVICE)) {
> +		ret = of_alias_get_id(dev->device_node, "spi");
> +		if (ret < 0)
> +			goto err_free;
> +		master->bus_num = ret;
> +		imx_spi_dt_probe(imx);
>  	}
>  
>  	imx->clk = clk_get(dev, NULL);
> -- 
> 2.13.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2018-12-14 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13  8:01 Alexander Shiyan
2018-12-13  8:01 ` [PATCH] ARM: clps711x: Increase boot space Alexander Shiyan
2018-12-14 14:08 ` Sascha Hauer [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=20181214140851.5r72avd74etxydzh@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=shc_work@mail.ru \
    /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