From patchwork Wed Sep 7 13:37:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 75663 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp331052qgf; Wed, 7 Sep 2016 06:38:12 -0700 (PDT) X-Received: by 10.66.144.227 with SMTP id sp3mr17435496pab.131.1473255489693; Wed, 07 Sep 2016 06:38:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si3237773pac.259.2016.09.07.06.38.09; Wed, 07 Sep 2016 06:38:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757806AbcIGNiF (ORCPT + 27 others); Wed, 7 Sep 2016 09:38:05 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38647 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757779AbcIGNiC (ORCPT ); Wed, 7 Sep 2016 09:38:02 -0400 Received: by mail-wm0-f44.google.com with SMTP id 1so33033128wmz.1 for ; Wed, 07 Sep 2016 06:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0rrJoHR+b/TWlrLIeoKLge/cNO7f+b06HFrIwbj8L1k=; b=dyz9EhV6saWzvbSec7mw3Uj8FgO6EgbHlwo38095IAKjO50Ms3gy8IfIeK4scPIr8V 4dhjBhLJ6BxFiuxk1MQqXGEBnwqJ1s95CZDLDsYs9WenvwzZnust/EkZ+5yj9bYijFNY dVd7tSpfMFVoavLLRp5vQU1D4JVYI10wL8iEOGbUmlF9DajbQmiIk86j5hKmQgZrgVlR 6jCPfRINEwDFeHUrA2kwe/67+/xnyQYzdXTHxRa4MMJvLAeEfH1ncjtbKeNFHlxrZT2n fS3oIZD/A8q+ywLvkUJtTujoQ3jwzaT9GIwMduVidiFF0LgZYISO5vqGTdZ4qy342JJ7 eevw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0rrJoHR+b/TWlrLIeoKLge/cNO7f+b06HFrIwbj8L1k=; b=RCBgzqH1U5fI50QW0vmwZFvQsdyrwUvwFwzgOR54Y+firqrCctlVRzCqWnwcJGPe40 DVoxqI4Zs2PHq66fUhMy+kSCHIA7B0U7ez/qCfSHCDP/6V78x0asMSgqrXOVI/KUUWq3 +8OJNlQ21YtPwKboTrutOn8EWR/M1q/nU/3Ohlhq0lzkAy30zJGdoGsWT8FDvZdg+nB6 bzSfyRRqsFLNROwPfh/DfOMTLSEouikX7Yx2Q77zvdmRjIj//Wn1gxSpfkSSJyYI7Ru7 yEFx4HnVb4yATMdakGG1/3Wih0ubBe2Kn+vD5aT7PEMnQchnVoFF7UW2xGmp/Br9wRoA ZEzg== X-Gm-Message-State: AE9vXwP7BfLsXvkCRYZk//xRnuJysBC4shES4arncbib9G+df7IK1EJjvTAuPyTE8oNWQfOC X-Received: by 10.28.140.10 with SMTP id o10mr3812538wmd.36.1473255481030; Wed, 07 Sep 2016 06:38:01 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id 190sm4363889wmk.13.2016.09.07.06.38.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 06:38:00 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Alexandre Courbot , Andy Shevchenko , Vignesh R , Yong Li , Geert Uytterhoeven Cc: linux-gpio , LKML , Bartosz Golaszewski Subject: [PATCH v3 4/5] gpio: pca953x: remove an unused variable Date: Wed, 7 Sep 2016 15:37:51 +0200 Message-Id: <1473255472-16090-5-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1473255472-16090-1-git-send-email-bgolaszewski@baylibre.com> References: <1473255472-16090-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The chip_type variable in struct pca953x_chip is no longer required. Remove it. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-pca953x.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 018bd18..b08ed52 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -129,7 +129,6 @@ struct pca953x_chip { struct i2c_client *client; struct gpio_chip gpio_chip; const char *const *names; - int chip_type; unsigned long driver_data; const struct pca953x_offset *offset; @@ -771,8 +770,6 @@ static int pca953x_probe(struct i2c_client *client, } } - chip->chip_type = PCA_CHIP_TYPE(chip->driver_data); - mutex_init(&chip->i2c_lock); /* initialize cached registers from their original values. @@ -787,13 +784,14 @@ static int pca953x_probe(struct i2c_client *client, chip->write_regs = pca953x_write_regs_24; chip->read_regs = pca953x_read_regs_24; } else { - chip->write_regs = chip->chip_type == PCA953X_TYPE ? - pca953x_write_regs_16 : - pca957x_write_regs_16; + if (PCA_CHIP_TYPE(chip->driver_data) == PCA953X_TYPE) + chip->write_regs = pca953x_write_regs_16; + else + chip->write_regs = pca957x_write_regs_16; chip->read_regs = pca953x_read_regs_16; } - if (chip->chip_type == PCA953X_TYPE) + if (PCA_CHIP_TYPE(chip->driver_data) == PCA953X_TYPE) ret = device_pca953x_init(chip, invert); else ret = device_pca957x_init(chip, invert);