From patchwork Thu Dec 21 00:37:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10126845 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 444DD60388 for ; Thu, 21 Dec 2017 00:37:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 367D12960C for ; Thu, 21 Dec 2017 00:37:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AE6329973; Thu, 21 Dec 2017 00:37:52 +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=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 BE3E62960C for ; Thu, 21 Dec 2017 00:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756720AbdLUAhu (ORCPT ); Wed, 20 Dec 2017 19:37:50 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:41827 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756426AbdLUAht (ORCPT ); Wed, 20 Dec 2017 19:37:49 -0500 Received: by mail-wm0-f68.google.com with SMTP id g75so13124438wme.0 for ; Wed, 20 Dec 2017 16:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=yANiqjuiNQW7DCK31+6HjbExQGtrzxlKst2XzUlJ++g=; b=H+Ceds67pAm4qbc5pLMHybu81ZmkHAZqRSrHbAnJJ+DbvoIQVyaBoAmS2CykQmxRdf hth10SVoFaLyMwWon7aL4GnaaIEbsUy/Ox5GrWn8Hu2ozkXqMwD5sxD8Hv4KqdybAr1M aixnB5MWwH4dhHBH+I7ARnrV16Q8rItd59PVQ= 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; bh=yANiqjuiNQW7DCK31+6HjbExQGtrzxlKst2XzUlJ++g=; b=MvpJdXocsQaS8hJoiN102L6T5LMTmeU6kqYZDiqwhz3H1MIVQYHr+7bvCeqP/NLM13 vQw5JR3prW4i/h4CzS8Sd+ArPpruEu5Lvm1THa4D561TkKWaxCvwkN+dze51nfK9362b HP6/FIeUK/gaZ3UpLR7UHGHPr6e2kI40u22w8bT3ssmi/xPoxDBmQhewuLWPqZ6Gr9ZE 3nFNL8DyR7JmfaKSBXwbtCKuEaV8zlVEuXfGFHauTEOQcicWb6wg+vbUUb3Nr5/cYBW9 zlKLjyR8k2tL2syZbOsWnmn55DZ/x4AiOIV47fDkzKAiUvFoHBArwEslJpHcfwFL9LF2 2+Fg== X-Gm-Message-State: AKGB3mKKFGEuAqm1xTMqLUZIbGENppNcu2Fqhg0d2Y3UUxhpvzdMbpTe 40Z8HShczqDQ9zrCvJRxwiLZAQ== X-Google-Smtp-Source: ACJfBovaIAM+H9f5rjhqXy4N2+w2wvIFczKrB+VkMPtT9ZhA99edaYnvGhCyFH1cAfG+PwS5+DudRA== X-Received: by 10.28.209.141 with SMTP id i135mr7488329wmg.153.1513816667980; Wed, 20 Dec 2017 16:37:47 -0800 (PST) Received: from wildmoose.dk ([2a01:488:66:1000:57e6:57d1:0:1]) by smtp.gmail.com with ESMTPSA id f42sm14754852wrf.46.2017.12.20.16.37.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 16:37:47 -0800 (PST) From: Rasmus Villemoes To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown Cc: Rasmus Villemoes , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: pxa2xx: avoid redundant gpio_to_desc(desc_to_gpio()) round-trip Date: Thu, 21 Dec 2017 01:37:31 +0100 Message-Id: <20171221003731.21633-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.11.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 gpio_free(gpio) simply does gpiod_free(gpio_to_desc(gpio)), so it's simpler and cleaner to use gpiod_free directly. Signed-off-by: Rasmus Villemoes --- drivers/spi/spi-pxa2xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 4cb515a3104c..c209dc1047b5 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1237,7 +1237,7 @@ static int setup_cs(struct spi_device *spi, struct chip_data *chip, * different chip_info, release previously requested GPIO */ if (chip->gpiod_cs) { - gpio_free(desc_to_gpio(chip->gpiod_cs)); + gpiod_free(chip->gpiod_cs); chip->gpiod_cs = NULL; } @@ -1417,7 +1417,7 @@ static void cleanup(struct spi_device *spi) if (drv_data->ssp_type != CE4100_SSP && !drv_data->cs_gpiods && chip->gpiod_cs) - gpio_free(desc_to_gpio(chip->gpiod_cs)); + gpiod_free(chip->gpiod_cs); kfree(chip); }