[PATCH] spi: imx: Remove the use of property "fsl, spi-num-chipselects"

Sascha Hauer s.hauer at pengutronix.de
Sun Jun 26 23:47:06 PDT 2016


On Fri, Jun 24, 2016 at 06:04:22PM +0300, Alexander Shiyan wrote:
> The "fsl,spi-num-chipselects" property will be marked obsolete soon.
> This patch updates the driver to be ready to such changes.
> 
> Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
> ---
>  drivers/spi/imx_spi.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
> index 99ec228..dc7a8c8 100644
> --- a/drivers/spi/imx_spi.c
> +++ b/drivers/spi/imx_spi.c
> @@ -515,23 +515,16 @@ static __maybe_unused struct spi_imx_devtype_data spi_imx_devtype_data_2_3 = {
>  static int imx_spi_dt_probe(struct imx_spi *imx)
>  {
>  	struct device_node *node = imx->master.dev->device_node;
> -	int ret, i;
> -	u32 num_cs;
> +	int i;
>  
>  	if (!node)
>  		return -ENODEV;
>  
> -	ret = of_property_read_u32(node, "fsl,spi-num-chipselects", &num_cs);
> -	if (ret)
> -		return ret;
> -
> -	imx->master.num_chipselect = num_cs;
> -	imx->cs_array = xzalloc(sizeof(u32) * num_cs);
> +	imx->master.num_chipselect = of_gpio_named_count(node, "cs-gpios");
> +	imx->cs_array = xzalloc(sizeof(u32) * imx->master.num_chipselect);
>  
> -	for (i = 0; i < num_cs; i++) {
> -		int cs_gpio = of_get_named_gpio(node, "cs-gpios", i);
> -		imx->cs_array[i] = cs_gpio;
> -	}
> +	for (i = 0; i < imx->master.num_chipselect; i++)
> +		imx->cs_array[i] = of_get_named_gpio(node, "cs-gpios", i);
>  
>  	return 0;
>  }
> -- 
> 2.4.9
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at 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 |



More information about the barebox mailing list