Received: by 10.192.165.156 with SMTP id m28csp430554imm; Mon, 16 Apr 2018 02:43:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/7CCarvAghgKW4+bW1lrJ1jgupZ/fFeTP6oiYAKZrdp1l/wZta7cqvWxvjC8k+JU5Hgorz X-Received: by 10.98.101.131 with SMTP id z125mr4097217pfb.208.1523871801973; Mon, 16 Apr 2018 02:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523871801; cv=none; d=google.com; s=arc-20160816; b=z0S9bKZfILMvkInVADHhWattEc3XrMWx2qx+OT+JFjKjd4u4HZy5grSY76fBDLDFeS kfRSzEEfeP3iYVe3uPuc+yG7dOzpRr9GCoXjkyZcd11AogeUWb2zqBIzoHKs4/MTkaLA NJWlV4+zuRkvnzGuA4NhokyvvZ+uiPN5rvIu1uELtkSr5fDf2zDZiuCiNC/Dab/4X1xV HtyVogVhTMTRkPFjOozwLRNOfcz2I/Ndn7akJuxYZYr+9Ie2i9LWfWurB4JPGcIHsdZi lqxrCdDXHScKTY9fsCiDQ8b8ysRNzrWUy7cbTYzYeZsa48CAx333xy8bv9aNC40qrq+Z rqrQ== 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=/KP/UP0LBtw7LQ6E68oujILqD59RGiaI4HY1zpETehw=; b=joKf1PpiBAahh5HwleSVICcHPrNSk8hgsRN7jSsJ3fCFJg31hPxTay7g4fhEvZGxyY NqMB5DpGY9bSRGpasr9O4vd2xu2A+6hmNGNJC7C6J0UYHMQrSxY7DImT3VF2RY2ZqNkc Q8OQuzy01+2UN6vrCUVe2/Qw2LfCQb1zGGd0tfVY6iccJP3ykjE1kqF0jLoOJ6sH1HXm i73Axze1IGLImhRisDgodgkIDaZSILh0TNSivyPUqC+cyQGv18reeRiqyrVxvQnn/5RW Ql6qO8z/WBzNJbt8nrQ2egsO8YWjWODqIaGKNHWCn1mMYLo3oT+0+LPrQ5Gagpd6FiWt SwOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uRS9qd0r; 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 b6si4882162pfe.265.2018.04.16.02.43.07; Mon, 16 Apr 2018 02:43: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=uRS9qd0r; 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 S1754466AbeDPJfF (ORCPT + 99 others); Mon, 16 Apr 2018 05:35:05 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:43504 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754386AbeDPJfD (ORCPT ); Mon, 16 Apr 2018 05:35:03 -0400 Received: by mail-wr0-f195.google.com with SMTP id y7so23987795wrh.10; Mon, 16 Apr 2018 02:35:02 -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=/KP/UP0LBtw7LQ6E68oujILqD59RGiaI4HY1zpETehw=; b=uRS9qd0rQTm9MlFCWbKRQXB6B3VFj0QpR6O//72Uhm8QhviUnpM7S1eUgaKsbGRRGf +wPSZ5DBpFiHXo/XbB3/6OvpDKqsy5Z4JoRoMH9Qe1mRt7f/3NM1rdXoqVU7d6zTZh+8 sxsCxiW0HTLPrLqyXNZQO7z1bmfTZWldRI6aYfqjZ59Wn1zkYJ2l6PBH0AHn+l5oLDyz HdeHNXMFEEA1a7NG5rrlVQsTop9dOSYU649WRYvinGXvPGXqVQx1gJrVKUS0DTD7IzQo nGEDGZBVpdBM+CcWJIwrXPwOy08p2b4kBPppt4oJA/MZyvVCKIUWyI7EZ2fCNX/SCJ3H 1E1A== 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=/KP/UP0LBtw7LQ6E68oujILqD59RGiaI4HY1zpETehw=; b=Z1dIJ3V0YT/ccVcsugtpRh/oPcn4chJ2M596XWgWpfIrKUIhfYVaT3997gN3nM8KJb bAom9nIbK0oIG5MVT4t7uHqhREWsroWrOGqcv1/vVxZYcXxWBSuIU/yoUhKTx4LEOsHg ZiQietqhdlsZlf18mS0fW8THOzzDbB9OUXAr5Mf9/3HRnAUllZ9iLZeOmI5Qxf9E/1Wx QCZqOLbQCmbmTSEvU74UZLComr++yyJ4URx+enBy0UygBOoiEQVoLD/AsVTI4H3jJ1Q0 z4shtFTX9cyk1aGYYTSKFLNjNLh9HuviR9RWGVTUw7QxQV7U/OoF08iE7IQADt0AJnNZ 2v3g== X-Gm-Message-State: ALQs6tC5amOmFQAJ+GR11j1nwWl+50LhJZBiyZBXXbh8JYJ6Mu8jyE9Y J1Te7MaEmdFJJg2jp825N/M= X-Received: by 10.28.16.85 with SMTP id 82mr9173429wmq.4.1523871301899; Mon, 16 Apr 2018 02:35:01 -0700 (PDT) Received: from localhost.localdomain (146.187.3.109.rev.sfr.net. [109.3.187.146]) by smtp.gmail.com with ESMTPSA id t6sm2705335wre.32.2018.04.16.02.34.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 02:35:01 -0700 (PDT) From: Romain Izard To: Nicolas Ferre , Felipe Balbi , Greg Kroah-Hartman , Alexandre Belloni , Ludovic Desroches Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, Romain Izard Subject: [PATCH 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod Date: Mon, 16 Apr 2018 11:34:03 +0200 Message-Id: <20180416093405.16612-2-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180416093405.16612-1-romain.izard.pro@gmail.com> References: <20180416093405.16612-1-romain.izard.pro@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When converting to GPIO descriptors, gpiod_get_value automatically handles the line inversion flags from the device tree. Do not invert the line twice. Fixes: 3df034081021fa4b6967ce3364bc7d867ec1c870 Signed-off-by: Romain Izard --- drivers/usb/gadget/udc/atmel_usba_udc.c | 3 +-- drivers/usb/gadget/udc/atmel_usba_udc.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 27c16399c7e8..0fe3d0feb8f7 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -417,7 +417,7 @@ static inline void usba_int_enb_set(struct usba_udc *udc, u32 val) static int vbus_is_present(struct usba_udc *udc) { if (udc->vbus_pin) - return gpiod_get_value(udc->vbus_pin) ^ udc->vbus_pin_inverted; + return gpiod_get_value(udc->vbus_pin); /* No Vbus detection: Assume always present */ return 1; @@ -2076,7 +2076,6 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, udc->vbus_pin = devm_gpiod_get_optional(&pdev->dev, "atmel,vbus", GPIOD_IN); - udc->vbus_pin_inverted = gpiod_is_active_low(udc->vbus_pin); if (fifo_mode == 0) { pp = NULL; diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index 969ce8f3c3e2..d7eb7cf4fd5c 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -326,7 +326,6 @@ struct usba_udc { const struct usba_udc_errata *errata; int irq; struct gpio_desc *vbus_pin; - int vbus_pin_inverted; int num_ep; int configured_ep; struct usba_fifo_cfg *fifo_cfg; -- 2.14.1