From patchwork Mon Jul 10 14:09:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 107298 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3471152qge; Mon, 10 Jul 2017 07:09:13 -0700 (PDT) X-Received: by 10.84.215.141 with SMTP id l13mr18821468pli.116.1499695753406; Mon, 10 Jul 2017 07:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499695753; cv=none; d=google.com; s=arc-20160816; b=ludyeFgSa1NYIqTlaxUlJZzIk4FwA4q60n0nkXXnlUAUUnmx/5fWImncAEDwdLHrCL GOchub0+aQQ/L5M3z62+TMgvmG9MQ3C0BQleHXgYSVLznProbPca3hbqsoLQU6H0si3+ 2JfJ7EnT4GfMTZnVenBYUP0b6rt3lplsjU5eUZ5A9Vt8vzeoC+JVezUSWB7U6zSD6vWW 8eI5TTbUmgH7UVhPqgo1PwTK/C3mTZ0/pYFcHIW4IH6ONUqUWSnFqyX+pmApVcb2MNWI n5ajRMrW8oXpmnq6QihaAjzveNbs9kJ0jyF5U0M2T7mp/NH0uIW3WrrY/P0/MqAZQF7P mYyw== 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=uON43OOJ/J4fzCGBgdXl506g2qshaTFeSpK/gVMqoP0=; b=l7oBEAIqIdWc7J3ZKL+wx1aCWWu+EQeB5qZi8l56e8JGtDjuMJBlB7n12YJHlagpwf qRljaMN1khRVbd5ncFCveiT1t51Jm7/2+DLDHTMkBV3DlflEszz7l/pX6yj/pknyWmI1 hCrcghWvA7lUPSyFNzHqigDqJsQbd33jTOD+xs/zXZJBvm8/SJPRL6uv56D6Er7vuatC tJ0JdsxHIDQsukW4vGN+kGfyr/nHB14B24NV81VrxcY4aAr8qd1HaB9rLaNiFEDtMCC1 huLqy0IqaxaQjg3Myq3CEEFRJ6w9gt0YAtEjuXMwj5xueORqGd6oFWvzyAW1B2ZiBRMG IJSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=JMRTqFeb; 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 j19si8293859pgn.452.2017.07.10.07.09.13; Mon, 10 Jul 2017 07:09: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=neutral (body hash did not verify) header.i=@linaro.org header.b=JMRTqFeb; 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 S932337AbdGJOJM (ORCPT + 4 others); Mon, 10 Jul 2017 10:09:12 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:32783 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932302AbdGJOJL (ORCPT ); Mon, 10 Jul 2017 10:09:11 -0400 Received: by mail-lf0-f52.google.com with SMTP id z78so62380129lff.0 for ; Mon, 10 Jul 2017 07:09: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; bh=P0cPxIjfsivLu43em5AYtn4sNN/l/t97w6/YoOOjdMw=; b=JMRTqFeby9+c/CYCcXQJlIxLB6ccMiJsvCHTmfYaJOwk3WSMESPqpcdC0QgipoOQNQ gpSI/X/Owlq5SOZerVfFU+NNlBZpHilEmeIkiPawx4FBL4lg6iTuFrI11rCCZMfQ4PyF Lb9cdhgQcrW/27KER2tI4vbp9DV65+O8QDuTg= 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=P0cPxIjfsivLu43em5AYtn4sNN/l/t97w6/YoOOjdMw=; b=V9nkKexqWYaM5VEI/coV+r+gScffIWMsWMj8ga6f7r7dVoE4tnJessCFPyz0Fx4hwH elUiTxdvn1ptvV+V72nE/t4aETkFU3AZzce3MqVEWfVrvRehTrqzilTN31tRz5ZtKACL xMHRpf0nsKjzia1WFqVM5Gefk9CZul4vv8dI9Y35JTKWIEddJ6O4HKUAes8HZWLWWsfs GC4FKifFSf24zZX68KL6DfuYNpStiUXRW08z/ViemxS+uzEIos74Tu7gjhPcA/9GgWAx Il68U+swYFJit+ZRBux2JtcGlF39FYHvp7folE8+S0eJNVs3AN7+8buxlQJlagussh64 B+Ew== X-Gm-Message-State: AIVw113hu3W8EYZLs8/BuT1obO+I6r42UpWHhmQIhhdPNn7DnJRHBsJJ mmYj01h/xr3LKdbSklJLew== X-Received: by 10.25.217.92 with SMTP id q89mr1194192lfg.70.1499695749693; Mon, 10 Jul 2017 07:09:09 -0700 (PDT) Received: from genomnajs.bredbandsbolaget.se (c-8d7271d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.114.141]) by smtp.gmail.com with ESMTPSA id h74sm2725002lfh.31.2017.07.10.07.09.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 07:09:08 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Jan Kiszka , Andy Shevchenko , Greg Kroah-Hartman , devicetree@vger.kernel.org Subject: [PATCH] gpio/serial: revert "linux,first-pin" property handling Date: Mon, 10 Jul 2017 16:09:02 +0200 Message-Id: <20170710140902.21935-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This is not a legal device tree property, because its binding has not been reviewed and approved, nor does it exist in any device tree binding document. It is further wrong, because it is added to the GPIO offset which is by definition controller-local. Cc: Jan Kiszka Cc: Andy Shevchenko Cc: Greg Kroah-Hartman Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- This got in because I was stressed and was not paying attention. Sorry about not noticing earlier, but I usually strongly nix any such properties, please discuss this on the device tree list first. --- drivers/gpio/gpio-exar.c | 25 +++++++++---------------- drivers/tty/serial/8250/8250_exar.c | 2 -- 2 files changed, 9 insertions(+), 18 deletions(-) -- 2.9.4 -- 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 diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c index fb8d304cfa17..d02c5260525f 100644 --- a/drivers/gpio/gpio-exar.c +++ b/drivers/gpio/gpio-exar.c @@ -31,7 +31,6 @@ struct exar_gpio_chip { int index; void __iomem *regs; char name[20]; - unsigned int first_pin; }; static void exar_update(struct gpio_chip *chip, unsigned int reg, int val, @@ -53,9 +52,9 @@ static int exar_set_direction(struct gpio_chip *chip, int direction, unsigned int offset) { struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip); - unsigned int addr = (offset + exar_gpio->first_pin) / 8 ? + unsigned int addr = offset / 8 ? EXAR_OFFSET_MPIOSEL_HI : EXAR_OFFSET_MPIOSEL_LO; - unsigned int bit = (offset + exar_gpio->first_pin) % 8; + unsigned int bit = offset % 8; exar_update(chip, addr, direction, bit); return 0; @@ -76,9 +75,9 @@ static int exar_get(struct gpio_chip *chip, unsigned int reg) static int exar_get_direction(struct gpio_chip *chip, unsigned int offset) { struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip); - unsigned int addr = (offset + exar_gpio->first_pin) / 8 ? + unsigned int addr = offset / 8 ? EXAR_OFFSET_MPIOSEL_HI : EXAR_OFFSET_MPIOSEL_LO; - unsigned int bit = (offset + exar_gpio->first_pin) % 8; + unsigned int bit = offset % 8; return !!(exar_get(chip, addr) & BIT(bit)); } @@ -86,9 +85,9 @@ static int exar_get_direction(struct gpio_chip *chip, unsigned int offset) static int exar_get_value(struct gpio_chip *chip, unsigned int offset) { struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip); - unsigned int addr = (offset + exar_gpio->first_pin) / 8 ? + unsigned int addr = offset / 8 ? EXAR_OFFSET_MPIOLVL_HI : EXAR_OFFSET_MPIOLVL_LO; - unsigned int bit = (offset + exar_gpio->first_pin) % 8; + unsigned int bit = offset % 8; return !!(exar_get(chip, addr) & BIT(bit)); } @@ -97,9 +96,9 @@ static void exar_set_value(struct gpio_chip *chip, unsigned int offset, int value) { struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip); - unsigned int addr = (offset + exar_gpio->first_pin) / 8 ? + unsigned int addr = offset / 8 ? EXAR_OFFSET_MPIOLVL_HI : EXAR_OFFSET_MPIOLVL_LO; - unsigned int bit = (offset + exar_gpio->first_pin) % 8; + unsigned int bit = offset % 8; exar_update(chip, addr, value, bit); } @@ -120,7 +119,7 @@ static int gpio_exar_probe(struct platform_device *pdev) { struct pci_dev *pcidev = to_pci_dev(pdev->dev.parent); struct exar_gpio_chip *exar_gpio; - u32 first_pin, ngpios; + u32 ngpios; void __iomem *p; int index, ret; @@ -132,11 +131,6 @@ static int gpio_exar_probe(struct platform_device *pdev) if (!p) return -ENOMEM; - ret = device_property_read_u32(&pdev->dev, "linux,first-pin", - &first_pin); - if (ret) - return ret; - ret = device_property_read_u32(&pdev->dev, "ngpios", &ngpios); if (ret) return ret; @@ -161,7 +155,6 @@ static int gpio_exar_probe(struct platform_device *pdev) exar_gpio->gpio_chip.ngpio = ngpios; exar_gpio->regs = p; exar_gpio->index = index; - exar_gpio->first_pin = first_pin; ret = devm_gpiochip_add_data(&pdev->dev, &exar_gpio->gpio_chip, exar_gpio); diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index b5c98e5bf524..4fb3a4ed4a1f 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -261,7 +261,6 @@ __xr17v35x_register_gpio(struct pci_dev *pcidev, } static const struct property_entry exar_gpio_properties[] = { - PROPERTY_ENTRY_U32("linux,first-pin", 0), PROPERTY_ENTRY_U32("ngpios", 16), { } }; @@ -326,7 +325,6 @@ static int iot2040_rs485_config(struct uart_port *port, } static const struct property_entry iot2040_gpio_properties[] = { - PROPERTY_ENTRY_U32("linux,first-pin", 10), PROPERTY_ENTRY_U32("ngpios", 1), { } };