From patchwork Wed Apr 3 04:01:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10882699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D32D1800 for ; Wed, 3 Apr 2019 04:02:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 173D628989 for ; Wed, 3 Apr 2019 04:02:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B7A0289B5; Wed, 3 Apr 2019 04:02:53 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 A92DD289B9 for ; Wed, 3 Apr 2019 04:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbfDCEBy (ORCPT ); Wed, 3 Apr 2019 00:01:54 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45032 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbfDCEBy (ORCPT ); Wed, 3 Apr 2019 00:01:54 -0400 Received: by mail-pf1-f195.google.com with SMTP id y13so7441246pfm.11; Tue, 02 Apr 2019 21:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VXdsa+2KWn8DAZgbfHHYyO+0se1bIoGL2CFNu28TrmY=; b=a7j6MPR7XLKdGlqUQuEnwGPzcOTUBmf9eLl0p5ceJwDl6DF/dLwa0iON/Wo3bHD8IJ pt/YCBBNjrtSySM76empw64qwzk8JBfOryyse3zj5mO2t7Vhrf4laSF6EOKU3UhLGLUY o6Pzb9TqXD5Plj9H25j3UDQmVopFjcdB2UU7An7VJtsvsNIG7FGEveIG3uSv79eYmZYi q0WPUq3MyW3N271Rs5erfJTnDhMslZTN7DrRkizvY4C5B2fMbSxsOzyill+hGRUgXni5 aqzxeDSPk038NcvYNYIJsB+78UyRXFC7/g4UEckMgzjWLKJPczhUnR7BgSntSM2GvKFT slww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VXdsa+2KWn8DAZgbfHHYyO+0se1bIoGL2CFNu28TrmY=; b=auaUOU/PsaBKnXxToe26xw3WfvdoUBuEzq4r7kFR9RKucC9rDk3dvjGH9TUIIibHTn 4Da4gr4Ns3HypZ8HaQIaUd3zCGU0lAx1lSt9AD95JdRg+eBHIipDZHxHNybvMaKd/1r2 j5vbvqhtEA6PFbwo9VQUCcU4jGwM9yIXfBkQH83GmO0kt13M3/FCZCE9cbKIH03P6A7s J2I4e9pnLv2dMeJ8ILzAd4DZ8Psl16CivZVciBxAwpyDcuJQFd7zEXAESaOYAnykYELr bR6dXdOaexUTE79OD8Lszo4N7q8RHdZXepciNgqXZmJrlTRU4vz6DQl0g9MarBN+SzjV GJ7A== X-Gm-Message-State: APjAAAWNLHo7IGE9/7b88+udivnBFd+29lOGO5F8/LG+7ZUtuzCxPM+J B/9FkNYwwvMT+3fA2Sd0404S6z7n X-Google-Smtp-Source: APXvYqx/JygKJndt7MjAfGuoPWrbcrV+adfQo/TrlVGGlJvLtg1o+1mtz7iqwqukMbay6Mdy+GOSBA== X-Received: by 2002:a63:5e43:: with SMTP id s64mr9729024pgb.15.1554264112696; Tue, 02 Apr 2019 21:01:52 -0700 (PDT) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id k14sm16278064pfb.125.2019.04.02.21.01.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Apr 2019 21:01:51 -0700 (PDT) From: Andrey Smirnov To: linux-spi@vger.kernel.org Cc: Andrey Smirnov , Mark Brown , Chris Healy , linux-kernel@vger.kernel.org Subject: [PATCH 02/12] spi: gpio: Add local struct device pointer in spi_gpio_probe() Date: Tue, 2 Apr 2019 21:01:23 -0700 Message-Id: <20190403040133.1459-3-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190403040133.1459-1-andrew.smirnov@gmail.com> References: <20190403040133.1459-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 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 Use a local "struct device *dev" in spi_gpio_probe() for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-spi@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/spi/spi-gpio.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 675fd65ebf1d..2869af5ff936 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -379,6 +379,7 @@ static int spi_gpio_probe(struct platform_device *pdev) struct spi_master *master; struct spi_gpio *spi_gpio; struct spi_gpio_platform_data *pdata; + struct device *dev = &pdev->dev; u16 master_flags = 0; bool use_of = 0; @@ -388,19 +389,19 @@ static int spi_gpio_probe(struct platform_device *pdev) if (status > 0) use_of = 1; - pdata = dev_get_platdata(&pdev->dev); + pdata = dev_get_platdata(dev); #ifdef GENERIC_BITBANG if (!pdata || (!use_of && !pdata->num_chipselect)) return -ENODEV; #endif - master = spi_alloc_master(&pdev->dev, sizeof(*spi_gpio)); + master = spi_alloc_master(dev, sizeof(*spi_gpio)); if (!master) return -ENOMEM; spi_gpio = spi_master_get_devdata(master); - spi_gpio->cs_gpios = devm_kcalloc(&pdev->dev, + spi_gpio->cs_gpios = devm_kcalloc(dev, pdata->num_chipselect, sizeof(*spi_gpio->cs_gpios), GFP_KERNEL); @@ -416,7 +417,7 @@ static int spi_gpio_probe(struct platform_device *pdev) if (pdata) spi_gpio->pdata = *pdata; - status = spi_gpio_request(&pdev->dev, spi_gpio, + status = spi_gpio_request(dev, spi_gpio, pdata->num_chipselect, &master_flags); if (status) return status; @@ -431,7 +432,7 @@ static int spi_gpio_probe(struct platform_device *pdev) master->setup = spi_gpio_setup; master->cleanup = spi_gpio_cleanup; #ifdef CONFIG_OF - master->dev.of_node = pdev->dev.of_node; + master->dev.of_node = dev->of_node; #endif spi_gpio->bitbang.master = master;