diff mbox

spi: spi-fsl-spi: Add OF bus-num property

Message ID 20161219120942.29022-1-joakim.tjernlund@infinera.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joakim Tjernlund Dec. 19, 2016, 12:09 p.m. UTC
Allow OF to specify bus enumeration. This uses the same property
as spi-fsl-dspi.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
---
 drivers/spi/spi-fsl-lib.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Joakim Tjernlund Jan. 13, 2017, 3:41 p.m. UTC | #1
On Mon, 2016-12-19 at 13:09 +0100, Joakim Tjernlund wrote:
> Allow OF to specify bus enumeration. This uses the same property
> as spi-fsl-dspi.
> 
> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> ---

Ping?

>  drivers/spi/spi-fsl-lib.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c
> index cb35d2f..3b06513 100644
> --- a/drivers/spi/spi-fsl-lib.c
> +++ b/drivers/spi/spi-fsl-lib.c
> @@ -140,7 +140,7 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
>  	struct mpc8xxx_spi_probe_info *pinfo;
>  	struct fsl_spi_platform_data *pdata;
>  	const void *prop;
> -	int ret = -ENOMEM;
> +	int ret = -ENOMEM, bus_num;
>  
>  	pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL);
>  	if (!pinfo)
> @@ -151,7 +151,9 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
>  
>  	/* Allocate bus num dynamically. */
>  	pdata->bus_num = -1;
> -
> +	ret = of_property_read_u32(np, "bus-num", &bus_num);
> +	if (ret >= 0)
> +		pdata->bus_num = bus_num;
>  #ifdef CONFIG_FSL_SOC
>  	/* SPI controller is either clocked from QE or SoC clock. */
>  	pdata->sysclk = get_brgfreq();
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c
index cb35d2f..3b06513 100644
--- a/drivers/spi/spi-fsl-lib.c
+++ b/drivers/spi/spi-fsl-lib.c
@@ -140,7 +140,7 @@  int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 	struct mpc8xxx_spi_probe_info *pinfo;
 	struct fsl_spi_platform_data *pdata;
 	const void *prop;
-	int ret = -ENOMEM;
+	int ret = -ENOMEM, bus_num;
 
 	pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL);
 	if (!pinfo)
@@ -151,7 +151,9 @@  int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 
 	/* Allocate bus num dynamically. */
 	pdata->bus_num = -1;
-
+	ret = of_property_read_u32(np, "bus-num", &bus_num);
+	if (ret >= 0)
+		pdata->bus_num = bus_num;
 #ifdef CONFIG_FSL_SOC
 	/* SPI controller is either clocked from QE or SoC clock. */
 	pdata->sysclk = get_brgfreq();