From patchwork Mon Sep 17 15:49:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 146853 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3936558ljw; Mon, 17 Sep 2018 08:49:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbMpFe6yx/J7sSSZcdz8b0/MTX4stLLdckrBI1SVJei3LCoJKDuITog+lklisaTQpShwJ2C X-Received: by 2002:a62:f5c1:: with SMTP id b62-v6mr26882178pfm.158.1537199353637; Mon, 17 Sep 2018 08:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537199353; cv=none; d=google.com; s=arc-20160816; b=rxZLFtNzj8TNPl+xyxEDSAelHkDalr9ssWti6XBLBE7VpkrqAPAxmbHYRkQv/PmT4b wzIkA0qhMZIaqMT0pBtT/dW/OZcTFThCNJqE7deckbeBFeDzM50yAV5SJoGOnTyeSjWv aRB0sX3Nachr30RVwR9LNMjcSPWIYlAFbl1G38tfQzJoOtimGq7CwxOszfv4msGWsiac MLpJikrfdTUWs/CXxa7MF7dAHa5rNbu4RTzCF48sHS3fiFfB4H4FxDxmCui+0dqbOIpl zoXUke6QsF3V+QXBrv9fqcIU7YWziPbgk9VP1q334LIzpIkAaDbXMLmwn4lPRFvCQvEx qDxg== 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; bh=wW1bjwK3ewXdPYOqr0DWQQQXAfU7sTMfUh8e5QC9we0=; b=r66PzzuOnq+JOifmiemYHnyHGyxlF4HipDQL6E+QC5erOANShH5OqdCnHH0bolV7n1 q2l/DYK9Hg2DueR843kFOElJewy47qI5IdYzS98rgSjdg2Bkk6e7gB9VQeAyUkQxDN9A SWEoomxMOt70MsLiHkYDpeWw2J2gUDl6h6gDSsJNrmVs2vTjytWbVrAZPaTzfNr/O5VR NQhkMlIl32lOUXCZEkDvvhQ1fjJQvZHnvubmgW95mQfQlYUJ2CqOPxnuquWsrlyc9khJ eJi7yTmGMvNhT2lkpi3xP0PG1u9rhqbIKJclzL7CdgLEsSU+xsRi2HnUlzD+fyvc4iTu C0DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRfkfGjb; 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=pass (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 s184-v6si15565371pgb.123.2018.09.17.08.49.13; Mon, 17 Sep 2018 08:49:13 -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=pass header.i=@linaro.org header.s=google header.b=FRfkfGjb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbeIQVRH (ORCPT + 5 others); Mon, 17 Sep 2018 17:17:07 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:34425 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbeIQVRH (ORCPT ); Mon, 17 Sep 2018 17:17:07 -0400 Received: by mail-pl1-f196.google.com with SMTP id f6-v6so7627339plo.1 for ; Mon, 17 Sep 2018 08:49:12 -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=wW1bjwK3ewXdPYOqr0DWQQQXAfU7sTMfUh8e5QC9we0=; b=FRfkfGjbzoAxJPM5Fh55xUu9vttaWerBeAFK9BhPA5PbQaTKEkJPICHN2JBnup97ph DSyAx5UD9th3kjCe4fv7vNHD9lx9/NkwY2eAYGyEJU0JsobNqIcLxclceBbkYabbgV2Z AtJ4EhW/u72ccJqcKYmhhnLiolD5UEbNGF8Hc= 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=wW1bjwK3ewXdPYOqr0DWQQQXAfU7sTMfUh8e5QC9we0=; b=oZJEEOcUY5rMevqBHuO4TLFDXZFuOXIdDnPYn/q0RZ/x9voOFiq+NFOWpVbNftCy+S G9hR7YSx2N/GE5t4s2GH9QVtmkOOfUjqwBb0mrxLEfsSTa8KHATz4bRBr+p7rEeidb6f fLhEi1kcJUp4+VQCykdmGPzgGCqOmguUziIeWRI2CeLPTcb1sJvB9XF7/cRcAUOc02xZ fWbEbuAVTtfsaB9nQInVgSl+34PgPJ7alM/FWGc3nt0ywp9TwM/3IcPWaNtu6+RbdFR8 /trZClCyy2rUtGMUbgZZ2cMJYBRo354SgLNk6PUjhU9834Nfjh6V1LHwMoX2lOf5HXvM ElfQ== X-Gm-Message-State: APzg51DSPXvkJ5uf+KwYjSEj7vKE9h7jIGFBqbw5+Pomwjws6dBMFlVC Vi3Fpv4S+0ora1ngYv66goJSC1Q3lBY= X-Received: by 2002:a17:902:6845:: with SMTP id f5-v6mr25696501pln.17.1537199351271; Mon, 17 Sep 2018 08:49:11 -0700 (PDT) Received: from localhost.localdomain ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id z2-v6sm16726638pgv.12.2018.09.17.08.49.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Sep 2018 08:49:09 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij Subject: [PATCH] gpio: Get rid of legacy header Date: Mon, 17 Sep 2018 08:49:03 -0700 Message-Id: <20180917154903.23374-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org A bunch of core gpiolib files still include the legacy API header for no good reason. After this only the gpiolib-legacy.c file includes it, which is fine. The sysfs ABI code has a pointless wrapper function around gpio_to_desc() we can just loose. Signed-off-by: Linus Walleij --- drivers/gpio/gpiolib-acpi.c | 1 - drivers/gpio/gpiolib-sysfs.c | 10 ++-------- 2 files changed, 2 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index c48ed9d89ff5..79271e08eea5 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -11,7 +11,6 @@ */ #include -#include #include #include #include diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 3dbaf489a8a5..3d7c90fe7189 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include @@ -444,11 +443,6 @@ static struct attribute *gpiochip_attrs[] = { }; ATTRIBUTE_GROUPS(gpiochip); -static struct gpio_desc *gpio_to_valid_desc(int gpio) -{ - return gpio_is_valid(gpio) ? gpio_to_desc(gpio) : NULL; -} - /* * /sys/class/gpio/export ... write-only * integer N ... number of GPIO to export (full access) @@ -467,7 +461,7 @@ static ssize_t export_store(struct class *class, if (status < 0) goto done; - desc = gpio_to_valid_desc(gpio); + desc = gpio_to_desc(gpio); /* reject invalid GPIOs */ if (!desc) { pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); @@ -514,7 +508,7 @@ static ssize_t unexport_store(struct class *class, if (status < 0) goto done; - desc = gpio_to_valid_desc(gpio); + desc = gpio_to_desc(gpio); /* reject bogus commands (gpio_unexport ignores them) */ if (!desc) { pr_warn("%s: invalid GPIO %ld\n", __func__, gpio);