From patchwork Mon Dec 19 12:09:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 9480201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83DCF60237 for ; Mon, 19 Dec 2016 12:18:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68D6528305 for ; Mon, 19 Dec 2016 12:18:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D5A12836D; Mon, 19 Dec 2016 12:18:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A39E228395 for ; Mon, 19 Dec 2016 12:18:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933559AbcLSMS0 (ORCPT ); Mon, 19 Dec 2016 07:18:26 -0500 Received: from smtp.transmode.se ([31.15.61.139]:58509 "EHLO smtp.transmode.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932909AbcLSMSZ (ORCPT ); Mon, 19 Dec 2016 07:18:25 -0500 X-Greylist: delayed 515 seconds by postgrey-1.27 at vger.kernel.org; Mon, 19 Dec 2016 07:18:25 EST Received: from gentoo-jocke.transmode.se (gentoo-jocke.transmode.se [172.20.4.10]) by smtp.transmode.se (Postfix) with ESMTP id D8630118ACF3; Mon, 19 Dec 2016 13:09:46 +0100 (CET) Received: from gentoo-jocke.transmode.se (gentoo-jocke.transmode.se [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.9/8.14.9) with ESMTP id uBJC9k8G029067; Mon, 19 Dec 2016 13:09:46 +0100 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.9/8.14.9/Submit) id uBJC9jit029066; Mon, 19 Dec 2016 13:09:45 +0100 From: Joakim Tjernlund To: linux-spi@vger.kernel.org Cc: Joakim Tjernlund Subject: [PATCH] spi: spi-fsl-spi: Add OF bus-num property Date: Mon, 19 Dec 2016 13:09:42 +0100 Message-Id: <20161219120942.29022-1-joakim.tjernlund@infinera.com> X-Mailer: git-send-email 2.10.2 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow OF to specify bus enumeration. This uses the same property as spi-fsl-dspi. Signed-off-by: Joakim Tjernlund --- 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();