From patchwork Sun Feb 16 02:43:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3657521 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C18B19F334 for ; Sun, 16 Feb 2014 02:43:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 011D3201DD for ; Sun, 16 Feb 2014 02:43:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A32C20172 for ; Sun, 16 Feb 2014 02:43:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbaBPCnZ (ORCPT ); Sat, 15 Feb 2014 21:43:25 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:61193 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbaBPCnY (ORCPT ); Sat, 15 Feb 2014 21:43:24 -0500 Received: by mail-pa0-f53.google.com with SMTP id lj1so13790976pab.26 for ; Sat, 15 Feb 2014 18:43:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=ehMljwXvkMLHL5XedpimcPIdUhnd8GquHxGbluM6YCU=; b=K+7BjB59+AxTI1Byxpv5ZPKtUQ/mLECsyCi7WuSHERfUlX5mXX/0SVRRZ7MGfXtrfc ep75E4sd0DwyXyDcoebvEkIBwJRB9FgE2gD4QbO+H/g0ny4Cv9eayMdVxpW5hACctr29 /XEzMlN37IKqsPMHCwMzYmoQxfpm8Md7KcF+VprVOUphktFJU0Oxci19XzqPZSgFXpnC SSeGBENLG4AITslW/fyEQ+dmUnYo3MTOhEqrcg3sIE1uR+93ublU4ctE+obCf6589Lzp GYPPJxkxlqH3PBoXs6xLzMDUml1rZlRPkKbuPyYHDG0+fObYUhswKQ/6a/pMbsnvDSUS 3M0w== X-Gm-Message-State: ALoCoQnWmmpXjO8Y8wVCrQgChC8S6heLSnSvqxTwdTU9hESJDEFH/5sV3bLSx7rEyrDMs7U+skCj X-Received: by 10.68.96.99 with SMTP id dr3mr18372988pbb.40.1392518603579; Sat, 15 Feb 2014 18:43:23 -0800 (PST) Received: from [192.168.0.102] (218-164-99-158.dynamic.hinet.net. [218.164.99.158]) by mx.google.com with ESMTPSA id fk4sm80479632pab.23.2014.02.15.18.43.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Feb 2014 18:43:22 -0800 (PST) Message-ID: <1392518598.18192.3.camel@phoenix> Subject: [PATCH] spi: mpc512x-psc: Remove redundant code to get bus_num from DT From: Axel Lin To: Mark Brown Cc: Anatolij Gustschin , Gerhard Sittig , linux-spi@vger.kernel.org Date: Sun, 16 Feb 2014 10:43:18 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For DT case, spi core will call of_alias_get_id() and set master->bus_num if it was not set. Signed-off-by: Axel Lin Tested-by: Gerhard Sittig --- drivers/spi/spi-mpc512x-psc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 56cead9..3822eef 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -465,10 +465,8 @@ static void mpc512x_spi_cs_control(struct spi_device *spi, bool onoff) gpio_set_value(spi->cs_gpio, onoff); } -/* bus_num is used only for the case dev->platform_data == NULL */ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, - u32 size, unsigned int irq, - s16 bus_num) + u32 size, unsigned int irq) { struct fsl_spi_platform_data *pdata = dev_get_platdata(dev); struct mpc512x_psc_spi *mps; @@ -487,7 +485,6 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, if (pdata == NULL) { mps->cs_control = mpc512x_spi_cs_control; - master->bus_num = bus_num; } else { mps->cs_control = pdata->cs_control; master->bus_num = pdata->bus_num; @@ -573,7 +570,6 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op) { const u32 *regaddr_p; u64 regaddr64, size64; - s16 id = -1; regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); if (!regaddr_p) { @@ -582,16 +578,8 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op) } regaddr64 = of_translate_address(op->dev.of_node, regaddr_p); - /* get PSC id (0..11, used by port_config) */ - id = of_alias_get_id(op->dev.of_node, "spi"); - if (id < 0) { - dev_err(&op->dev, "no alias id for %s\n", - op->dev.of_node->full_name); - return id; - } - return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64, - irq_of_parse_and_map(op->dev.of_node, 0), id); + irq_of_parse_and_map(op->dev.of_node, 0)); } static int mpc512x_psc_spi_of_remove(struct platform_device *op)