Received: by 10.192.165.156 with SMTP id m28csp1197623imm; Wed, 18 Apr 2018 05:56:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx49jj4V5yOYlgmytoCNSABScSpvjc1O88kDWRzP3T+Tp1iHyRVYB75vqhYvOxAR6hIQ2WXmQ X-Received: by 10.98.81.197 with SMTP id f188mr1916934pfb.136.1524056181059; Wed, 18 Apr 2018 05:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524056181; cv=none; d=google.com; s=arc-20160816; b=W+4IT7LdpJ1va3DOQtJafCU3aiyGnWTZoHUv6xXNjLd7kH1zyBljZlHy8omRi9MrVH SyTRbjyHTRnnShvSG5B9wiQmIfRUyZbvjJPUjYBJGk139+FUgsUomKrdFG7poxbSpBHx xr9Kcyq19QlR3PusSRVte2w5QpgE5e/HraQ+/3R0sj5TMfpsXqnhYtyoJfk6Sx2arEy1 RQJGMfJhwTvvJOsckpmWGkKYjHpbZ/4DqEooexeNt0MNBmNHIRDE/L4ZSRmqhEi0xaGL ptYYe6LDsjbUGN05HP3EVk+sWm6XPESABzKsgc8KzYsSMD7Px8Y6QfCychLBqLr+olLe u1dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=2ez3V99nS1e1/HJZy+OWc1qTc0RW55ZOP0uRWOzj2do=; b=K+6fQmI5cbHYt8UEvnBNC6A3QqFZE9OZYz89Dk6h2XDDABPObvr7WD0aUTSutxo/gH LzorBc1NnInFE3dnsRSHzsyaUwjULxktt88Srx7fdQ3YpfXpy4n5uJZ5unPXYx72kPmr GKJD69qZbtwsZdYcr/4IQlk1LSZsIR6mHUAF5aB0f3x+CI6vbVNFvlsMDe0JZzxvCwpR MGeh7Itp2Bz3J08Dx40QJQp+ht6UAGA7DVw2StZYfigLz6yYMUnTgNtFCOOHQ3ccI1vi KrBzPdPNUwNyJniJ4IGnzRfSeJdwHpdv21gq1o8JUToMwcTFrSc1oUybQILV4x0MZQme Ei7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BIv2b6tT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si1045560pgt.630.2018.04.18.05.56.01; Wed, 18 Apr 2018 05:56:21 -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=@gmail.com header.s=20161025 header.b=BIv2b6tT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754018AbeDRMxa (ORCPT + 99 others); Wed, 18 Apr 2018 08:53:30 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:35320 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753989AbeDRMx2 (ORCPT ); Wed, 18 Apr 2018 08:53:28 -0400 Received: by mail-yw0-f196.google.com with SMTP id i144-v6so465072ywc.2; Wed, 18 Apr 2018 05:53:27 -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; bh=2ez3V99nS1e1/HJZy+OWc1qTc0RW55ZOP0uRWOzj2do=; b=BIv2b6tTbzEOmuEymeXKZBqqdfH3WZlhPEep9z51gQbec2Sqzoyy1nvICJF5FFuYRJ 44lC0KJuUTIZQQwAtxxB6JkXPpNQWlhyDo+wzibro/myO0z+lbf6Wp0Xh4PO/zI6K7dz iaHTdqoZQ3Pyyuc8z9G5IIvhShaNWSEezHesgUYZePn4E22ljBP8UP2bM6V+/NRyEvMU AIBMs7CAKdedIBDCfelh2V6n6li1zM0TGTvVTKah7Cb2dg7NmZZzi++9pnptNcIJqcKP S6FxoQIRUSXlnlas1G4JBm+8lgaK81IQmMP0LKn8r9TbrE4+kPp/rn4XfTZaLq3BtH7P RS4Q== 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; bh=2ez3V99nS1e1/HJZy+OWc1qTc0RW55ZOP0uRWOzj2do=; b=L1myFFsCgCm6FkyfafvzH/JM7ATcEl4u9dgokk51jEOVlvYiClte+ixdW+ztntrkjd 00ryTp8ZVsmJ6IZ7oVInaG8i1e6WtKLWIsiS/Q/E1EfvamxLYl7MB1zrBm/mrpxLTEBl DTb5u7O5sKh1Lu1luujKW5tSW/wgIL+hUcHbXHz2iqD//SEkRrYlRgnAWh+/6acjKneQ +xUBzBYcUTc+VzMAcIt7sK1FgyPxZzyKa9NHDceoRb8RQ9HSU8Ohr8PbOL6ysa1F+Nqy DuUs/hjCrBG07ay2QIKtcwNXSYEOMNtXxjor6tVfpZ0G2Jx4ESnubB+5XjEGfyWgLFrp AYqQ== X-Gm-Message-State: ALQs6tCBGQVjBGg72DCaFgUkCn1QnXMPvXGA0n4NhUTxdu2dyktLCcrh Qo2MsRx0E83S9jc0Rlw0JP8= X-Received: by 2002:a0d:f403:: with SMTP id d3-v6mr828690ywf.48.1524056007516; Wed, 18 Apr 2018 05:53:27 -0700 (PDT) Received: from localhost ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id u9-v6sm410943ywl.35.2018.04.18.05.53.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Apr 2018 05:53:27 -0700 (PDT) From: William Breathitt Gray To: linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [PATCH 2/2] gpio: pcie-idio-24: Fix port memory offset for get_multiple/set_multiple callbacks Date: Wed, 18 Apr 2018 08:53:21 -0400 Message-Id: <00c65eb82280318e6d50f0c54fab4efd708beafa.1524000042.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ioread8/iowrite8 functions expect a memory offset argument. This patch fixes the ports array to provide the memory addresses of the respective device I/O registers. Fixes: ca37081595a2 ("gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks") Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-pcie-idio-24.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-pcie-idio-24.c b/drivers/gpio/gpio-pcie-idio-24.c index 835607ecf658..3e77c2a9a9fd 100644 --- a/drivers/gpio/gpio-pcie-idio-24.c +++ b/drivers/gpio/gpio-pcie-idio-24.c @@ -206,10 +206,10 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, unsigned long word_mask; const unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0); unsigned long port_state; - u8 __iomem ports[] = { - idio24gpio->reg->out0_7, idio24gpio->reg->out8_15, - idio24gpio->reg->out16_23, idio24gpio->reg->in0_7, - idio24gpio->reg->in8_15, idio24gpio->reg->in16_23, + void __iomem *ports[] = { + &idio24gpio->reg->out0_7, &idio24gpio->reg->out8_15, + &idio24gpio->reg->out16_23, &idio24gpio->reg->in0_7, + &idio24gpio->reg->in8_15, &idio24gpio->reg->in16_23, }; const unsigned long out_mode_mask = BIT(1); @@ -236,7 +236,7 @@ static int idio_24_gpio_get_multiple(struct gpio_chip *chip, /* read bits from current gpio port (port 6 is TTL GPIO) */ if (i < 6) - port_state = ioread8(ports + i); + port_state = ioread8(ports[i]); else if (ioread8(&idio24gpio->reg->ctl) & out_mode_mask) port_state = ioread8(&idio24gpio->reg->ttl_out0_7); else @@ -301,9 +301,9 @@ static void idio_24_gpio_set_multiple(struct gpio_chip *chip, const unsigned long port_mask = GENMASK(gpio_reg_size, 0); unsigned long flags; unsigned int out_state; - u8 __iomem ports[] = { - idio24gpio->reg->out0_7, idio24gpio->reg->out8_15, - idio24gpio->reg->out16_23 + void __iomem *ports[] = { + &idio24gpio->reg->out0_7, &idio24gpio->reg->out8_15, + &idio24gpio->reg->out16_23 }; const unsigned long out_mode_mask = BIT(1); const unsigned int ttl_offset = 48; @@ -327,9 +327,9 @@ static void idio_24_gpio_set_multiple(struct gpio_chip *chip, raw_spin_lock_irqsave(&idio24gpio->lock, flags); /* process output lines */ - out_state = ioread8(ports + i) & ~gpio_mask; + out_state = ioread8(ports[i]) & ~gpio_mask; out_state |= (*bits >> bits_offset) & gpio_mask; - iowrite8(out_state, ports + i); + iowrite8(out_state, ports[i]); raw_spin_unlock_irqrestore(&idio24gpio->lock, flags); } -- 2.16.2