From patchwork Thu Aug 17 17:14:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9906739 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 1819560386 for ; Thu, 17 Aug 2017 17:15:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2DDF28B71 for ; Thu, 17 Aug 2017 17:15:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7C0128B76; Thu, 17 Aug 2017 17:15:08 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 71F8C28B71 for ; Thu, 17 Aug 2017 17:15:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753189AbdHQROJ (ORCPT ); Thu, 17 Aug 2017 13:14:09 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:54234 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753669AbdHQROG (ORCPT ); Thu, 17 Aug 2017 13:14:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=P4KyhDKL4o5GKym9vrSYvednivLOH8KT9+U5gU6TPy8=; b=nPvmqPesIzQ/ 7f7RJux4uBtHcOaeLHaeL+C8MBNj//jyAQa8qHqwSpC0JE041NJimMeNyUOuwvnm3ThxwBr0BMhY/ USor3g5AncIctjKwEuCMqYgxW8NL9WQsVLFWNZ2VAeSkvcBb3PR1U0LVjhoVE2EmxLlpI1GxHN5Gg Sflss=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1diOMs-0007BL-DA; Thu, 17 Aug 2017 17:14:02 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1diOMs-0000Kx-0P; Thu, 17 Aug 2017 18:14:02 +0100 From: Mark Brown To: Suniel Mahesh Cc: Mark Brown , broonie@kernel.org, lukas@wunner.de, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, karthik@techveda.org, linux-spi@vger.kernel.org Subject: Applied "spi: Kernel coding style fixes" to the spi tree In-Reply-To: <1502974102-4033-1-git-send-email-sunil.m@techveda.org> Message-Id: Date: Thu, 17 Aug 2017 18:14:02 +0100 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 The patch spi: Kernel coding style fixes has been applied to the spi tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 9a9a047a39d9173b0639017e5ba249443e76dd9e Mon Sep 17 00:00:00 2001 From: Suniel Mahesh Date: Thu, 17 Aug 2017 18:18:22 +0530 Subject: [PATCH] spi: Kernel coding style fixes Earlier commit: "spi: Pick spi bus number from Linux idr or spi alias" (SHA1:9b61e302210eba55768962f2f11e96bb508c2408) has introduced some checkpatch issues. As pointed by Lukas Wunner this patch does the following: - remove whitespaces - fix warnings, suspect code indent for conditional statements - fix errors, code indent should use tabs - remove spaces at the start of the line Signed-off-by: Suniel Mahesh Signed-off-by: Mark Brown --- drivers/spi/spi.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index b851888a0a0b..f47d1ccdf292 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -424,7 +424,7 @@ static LIST_HEAD(spi_controller_list); /* * Used to protect add/del opertion for board_info list and * spi_controller list, and their matching process - * also used to protect object of type struct idr + * also used to protect object of type struct idr */ static DEFINE_MUTEX(board_lock); @@ -2075,7 +2075,6 @@ int spi_register_controller(struct spi_controller *ctlr) */ if (ctlr->num_chipselect == 0) return -EINVAL; - /* allocate dynamic bus number using Linux idr */ if ((ctlr->bus_num < 0) && ctlr->dev.of_node) { id = of_alias_get_id(ctlr->dev.of_node, "spi"); @@ -2090,16 +2089,14 @@ int spi_register_controller(struct spi_controller *ctlr) } } if (ctlr->bus_num < 0) { - mutex_lock(&board_lock); - id = idr_alloc(&spi_master_idr, ctlr, - SPI_DYN_FIRST_BUS_NUM, 0, GFP_KERNEL); - mutex_unlock(&board_lock); - if (WARN(id < 0, "couldn't get idr")) - return id; - - ctlr->bus_num = id; + mutex_lock(&board_lock); + id = idr_alloc(&spi_master_idr, ctlr, SPI_DYN_FIRST_BUS_NUM, 0, + GFP_KERNEL); + mutex_unlock(&board_lock); + if (WARN(id < 0, "couldn't get idr")) + return id; + ctlr->bus_num = id; } - INIT_LIST_HEAD(&ctlr->queue); spin_lock_init(&ctlr->queue_lock); spin_lock_init(&ctlr->bus_lock_spinlock); @@ -2222,18 +2219,16 @@ void spi_unregister_controller(struct spi_controller *ctlr) mutex_lock(&board_lock); found = idr_find(&spi_master_idr, ctlr->bus_num); mutex_unlock(&board_lock); - if (found != ctlr) { - dev_dbg(&ctlr->dev, + if (found != ctlr) { + dev_dbg(&ctlr->dev, "attempting to delete unregistered controller [%s]\n", dev_name(&ctlr->dev)); - return; - } - + return; + } if (ctlr->queued) { if (spi_destroy_queue(ctlr)) dev_err(&ctlr->dev, "queue remove failed\n"); } - mutex_lock(&board_lock); list_del(&ctlr->list); mutex_unlock(&board_lock);