From patchwork Fri Oct 20 10:29:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 116478 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1522332qgn; Fri, 20 Oct 2017 03:31:58 -0700 (PDT) X-Received: by 10.98.11.93 with SMTP id t90mr4644605pfi.304.1508495517939; Fri, 20 Oct 2017 03:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508495517; cv=none; d=google.com; s=arc-20160816; b=RnWCKoPLCJLL+SE69E+5dYYX5TcuT7Sm9k4XdLyVIqeh13suT1n/YbD1uDRTtlFmuK KbLGahWIUtRKQIoeqLUz8aSr12UK2Jv2ggsv2hfcUonYznMOwwuhDzb6+55KAFJWKhcS daevDtMBVMG8QZnzhxowCLD+KNGW+bzNIfqIeRxIw9TwHLvZ3dD5NFpG9tZzKXKBQ+6Q QNRU5lGhvfWHobBfqFjyxpbZOUMVlOQQN37qZYavE35KE8K/lU+/WkheLhA6dTNKmt3C eTrVsItndCXL+ZNK+MKA1wyC2r5VDRIqN+/JuQA+zNqyoM9hnbgT9+NapIxXp5erNe9Z WSdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=vIMCfA5wFOQN4CbTNShcbvrJY/ouUFKfHZbAPOPKrjg=; b=zrkpW21FPSuKHCmJnEvWHAlOQYGiJxlR82Jl3VS+Bb5UIRtdUUe9vH+r5YUoQ6EV/z nmjubZoLV64rXKu8kSQNIIsjagwwSc9mZhgRyRQwoQhZOv0QalyBQ1bnObjHDzZtiB3p /1IXwOD4xh8jLbfQ6EOl1rVuoz10ovokMvoDg+cx+eZJVORlmFiFRdOBllEKBR6oow+P EdlEQEo1nDkOUtGZc5BCYeAgcHyybeHC6KbnqfebyMUcSI0HI93F2p7HtVM0Auk1cgSJ 9ahbWM2sO3BpFlyPaIJkrgnHSNvTKmItLBuwh82/6m1yi9A//MQcrRRlP3i2sr+7cVaD X1nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DSnFzuRQ; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c80si605672pfb.238.2017.10.20.03.31.57; Fri, 20 Oct 2017 03:31:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DSnFzuRQ; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752663AbdJTKb5 (ORCPT + 6 others); Fri, 20 Oct 2017 06:31:57 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:43455 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbdJTKb4 (ORCPT ); Fri, 20 Oct 2017 06:31:56 -0400 Received: by mail-lf0-f67.google.com with SMTP id a16so12671609lfk.0 for ; Fri, 20 Oct 2017 03:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ZyoFEXz517qyAT25xJwK/9yW4M7MWpw+HhD/JthN3oM=; b=DSnFzuRQ7AyYb4ij+k+nKJeFxN1nqSFrZIldFKvBrMU8Sz/eV4Bs1bmRhVkQcEVoj1 //vgNC7QAGPhzb2FmhlSRVQ2AlMyQK/bHEwlfGru5herzv255Ec4ck95scq2dyj6b3Y0 l/slYIaHQ8g7jI23uFNnwpqYhZ43122JXsPBY= 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=ZyoFEXz517qyAT25xJwK/9yW4M7MWpw+HhD/JthN3oM=; b=FdXbMFpuX4ORmnuP44K4WODzg5v37Ep9lOp8fCWWprgGOiCn7kOhvnmPlpy/XA3nu3 bFjkplVdtBlOgal8gUTbv0KN2EQsQXj8IBkF7OwG5+X8zf+SmBhnA9D7G9He5g/h3+yr SSTILKeQJJRAe2MVZ3jCzaFkyiO6hfK96Vp+YT/NvxL+GfvZgZhCRR6dqDcV0dLUduHw 0wshmdaU5uOMX0vutGjr6lz5xaKuUqAUdfzGbaodDh6dM9PBR2+N9AeTYwvN7EWns9LM 6CNYMGWdVVUg3orvkkn2PNlNNPX7D3ZlR7Ri0t6vX9+rLG7lwV6ad7loJ8g2ub5kNkA0 +/zw== X-Gm-Message-State: AMCzsaWTLloWr7FVhbIMs28G/zqLm7sendCN3l54m/EzegNCZq6gZTH8 AJje9YYD428xjCf5d5i2LA/yGnQwp1Y= X-Google-Smtp-Source: ABhQp+RQVQV7I4WoQzoGEZ5G4pfK8fODa2nq9bfIN1n0BHs7kzhdYUxr0xSiy94AKYHAE7MITY4h6g== X-Received: by 10.46.88.9 with SMTP id m9mr1963498ljb.15.1508495514825; Fri, 20 Oct 2017 03:31:54 -0700 (PDT) Received: from localhost.localdomain (c-5f7c71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.124.95]) by smtp.gmail.com with ESMTPSA id s16sm166532ljd.77.2017.10.20.03.31.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 03:31:54 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Hoan Tran , Alan Tull Subject: [PATCH] gpio: dwapb: fix bgpio usage Date: Fri, 20 Oct 2017 12:29:51 +0200 Message-Id: <20171020102951.6305-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The DW APB GPIO driver uses the generic GPIO library gpio-mmio, and initialize the flags as "false", which should be 0. When no flags are given, the native endianness is used to access the MMIO registers, and the pin2mask() call can simply be converted to a BIT() call, as per the default pin2mask() implementation in gpio-mmio.c. Cc: Hoan Tran Cc: Alan Tull Signed-off-by: Linus Walleij --- drivers/gpio/gpio-dwapb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.13.6 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Alan Tull diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index d782ad195c89..6730c6642ce3 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -320,7 +320,7 @@ static int dwapb_gpio_set_debounce(struct gpio_chip *gc, struct dwapb_gpio_port *port = gpiochip_get_data(gc); struct dwapb_gpio *gpio = port->gpio; unsigned long flags, val_deb; - unsigned long mask = gc->pin2mask(gc, offset); + unsigned long mask = BIT(offset); spin_lock_irqsave(&gc->bgpio_lock, flags); @@ -482,7 +482,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio, (pp->idx * GPIO_SWPORT_DDR_SIZE); err = bgpio_init(&port->gc, gpio->dev, 4, dat, set, NULL, dirout, - NULL, false); + NULL, 0); if (err) { dev_err(gpio->dev, "failed to init gpio chip for port%d\n", port->idx);