From patchwork Fri Oct 27 20:21:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 117382 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1178060qgn; Fri, 27 Oct 2017 13:22:12 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Ssq0GsO5IG6UFJZfiDTdUCVJgoeMFhmNm6GZ+IobV6TGTeP9VMCXDjuWCibMHoCAYGslMJ X-Received: by 10.98.9.207 with SMTP id 76mr1545908pfj.70.1509135732292; Fri, 27 Oct 2017 13:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509135732; cv=none; d=google.com; s=arc-20160816; b=ystb7b2RrXkZ7I3zqp50UU2CwLfnYN3pdCBHe1MNWPePvNuaDVgcFWn8xYvZ/SDOsm 8nyycKjsAHbM4U5MND3awrkxRirtWNPFhzqTYuH78d9+PYHsqeXWvpt5M0iiT+p8rBku rdjVh7uQkBElYDMuI3HlVSBdzdM6o/U28cWUonef86v6fdE2H1z9Kg8B/RxvddY6kei/ 7fl3VnDDROoiH0mWll8st6jkxkFEiUmwLbKXeOK+SIFDtR5ThKDy3ITBKwlw+2C2H1gF +xSRC6qZjD+Reop8YO0qq34bGgoyeP1acRyrwm1G/0zBJ+DrgdWrOtN1AH03emZeRH52 mu0g== 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=CTFhVK/vNgoDy+aWIzC/JEmZlOoYDU2LzsDfjjyvytQ=; b=SIzJFiAGlhZ9dkGBqUvVWxoG8FVAeSN8Q6V6GOycJwLQW8SithM37P+5k+LXMMHgT6 zLqcgz9DNuc0DxYtRL0pMH8SVt5gQiX0Klz5nnAtuKywdMNJ9DEfcv+T+rgKvLKd0wRn eP/bLXbKU0tG/QD2yoNJaeuzsmGYgmDh18kqJEZsBqtNZzSyOf6DU/lkPHwYRkTNv8oC fizeHPz+Pe8gGGjnsVMkP4Z+6wje7YhGeNgCOcnz0sLVT/pffiDYrrCKBTiranPcFEDF kzB567jFSQtqYMo6DmnmBKwiwXqh7kSOmfzWQJs070fvx+Wns3KQh/Fjcfw5QBG6/aYd 00/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZpBikJL1; 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 m1si4794691pld.579.2017.10.27.13.22.12; Fri, 27 Oct 2017 13:22:12 -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=ZpBikJL1; 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 S1751937AbdJ0UWL (ORCPT + 6 others); Fri, 27 Oct 2017 16:22:11 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:56575 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbdJ0UWL (ORCPT ); Fri, 27 Oct 2017 16:22:11 -0400 Received: by mail-wm0-f68.google.com with SMTP id z3so5811324wme.5 for ; Fri, 27 Oct 2017 13:22:10 -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:in-reply-to:references; bh=0/NKbU3bn70N2wDAa/SJuZL5Bi72sfRkly7jnxJofBM=; b=ZpBikJL1ggvNWzPv3Bny1/uB4giQqGprbbknLJ/1K0XfIuE8QBuCuMtRZFP1TjSY0c tbnD4x4Ermh3uPHVPerS1eB5hmLpaorU43MmHd3YDliPSi2ujY/liM6zTR1R23eu/tFI x9PjmfS0sCYUiHUIevqNReIaQBncXeF1efwxU= 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=0/NKbU3bn70N2wDAa/SJuZL5Bi72sfRkly7jnxJofBM=; b=q/oIVF9AVMzkYKxOsAsTm/cbp2EIbntFqYTUoG/E6rl9RFGOwCkFJQNpGdmmx0rMbX suFVHY7Onamv6elukgA9qd1sHiFg8J1wU3jdwIPQW31f9O+gVrqEPFDbrBwvZXFq4F72 IV1a4xbBWuBkYFIfHtWIGLFkw6pUBCXi1mWCJQJLzGjcwvubX/qVb4ujIQuFKCvuJ8Oy yK7tRc4aaTIYHdgtECE4Vn6w5Yiw3akPakAuYXpgxiDw4hfdUb/UDHf+Wuy0eMn+YWbY 18IxZPbek7pnSYt74EP/c7XU/WRyDkmsp2aYVdUb5jVeb2TV//VYWRLlWvHsqTbizxN0 6kUw== X-Gm-Message-State: AMCzsaVzbXKOopM9TN94ioClm5J85ZUaXvDfIpAGhU+3h3qEEBdCHdro NdDE5gjERnqvA/5zOzwD2PMESWf+EGg= X-Received: by 10.28.178.205 with SMTP id b196mr1272031wmf.103.1509135729647; Fri, 27 Oct 2017 13:22:09 -0700 (PDT) Received: from localhost.localdomain ([160.171.245.11]) by smtp.gmail.com with ESMTPSA id c37sm10388722wrc.92.2017.10.27.13.22.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 13:22:08 -0700 (PDT) From: Ard Biesheuvel To: linux-gpio@vger.kernel.org Cc: linus.walleij@linaro.org, daniel.thompson@linaro.org, leif.lindholm@linaro.org, jaswinder.singh@linaro.org, masami.hiramatsu@linaro.org, Ard Biesheuvel , Axel Lin Subject: [PATCH 2/2] gpio: mb86s70: Revert "Return error if requesting an already assigned gpio" Date: Fri, 27 Oct 2017 21:21:48 +0100 Message-Id: <20171027202148.4188-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171027202148.4188-1-ard.biesheuvel@linaro.org> References: <20171027202148.4188-1-ard.biesheuvel@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Commit fd9c963c5661 ("gpio: mb86s70: Return error if requesting an already assigned gpio") adds code that infers from the state of the GPIO Pin Function Register (PFR) whether a GPIO has been assigned already. This assumes that the pin functions are set to 'peripheral' when the driver is loaded, which is not guaranteed. Also, the GPIO layer is perfectly capable of keeping track of which GPIOs have been assigned already, so we shouldn't need this check in the first place. This reverts commit fd9c963c5661af3403e77e312c0d9941773b6c1b. Cc: Axel Lin Cc: Linus Walleij Signed-off-by: Ard Biesheuvel --- drivers/gpio/gpio-mb86s7x.c | 5 ----- 1 file changed, 5 deletions(-) -- 2.11.0 -- 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: Axel Lin diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c index 6e1598471733..5cd77dcdbb16 100644 --- a/drivers/gpio/gpio-mb86s7x.c +++ b/drivers/gpio/gpio-mb86s7x.c @@ -53,11 +53,6 @@ static int mb86s70_gpio_request(struct gpio_chip *gc, unsigned gpio) spin_lock_irqsave(&gchip->lock, flags); val = readl(gchip->base + PFR(gpio)); - if (!(val & OFFSET(gpio))) { - spin_unlock_irqrestore(&gchip->lock, flags); - return -EINVAL; - } - val &= ~OFFSET(gpio); writel(val, gchip->base + PFR(gpio));