From patchwork Fri Jun 9 11:41:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 773820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wkgQf0XQ7z9s8N for ; Fri, 9 Jun 2017 21:43:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="NR6Yv0cR"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751806AbdFILnE (ORCPT ); Fri, 9 Jun 2017 07:43:04 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:35523 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667AbdFILlr (ORCPT ); Fri, 9 Jun 2017 07:41:47 -0400 Received: by mail-wr0-f176.google.com with SMTP id q97so30084288wrb.2 for ; Fri, 09 Jun 2017 04:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jca1lAnoEeypqgJ1ikNe6g5ZGRq0Kep10qF1h2a/rBk=; b=NR6Yv0cRGEWP79xXhDnGS//2ParQpGqSZMudITASpWuHQdxegWh47O6JkY/JecoA0F KtA+LeuQy8+3Cf+iUXSCTKSZiIndPlBQNJCqRByOPXDJ29PZgOe5waE66CJaNwi86W+c 6YekCN+NmCNP21Pm7EqlxCvr76A3KDt5JlL/Uv7bHs2DMxNovfw1vanV6hmFuN8slogP /jpsynYsde6xjOqe6NDsrWe7azWM4nP0ersAMsagqoEON0w0BjWO2o3KCCGBfhw/aB4a mlc84t9v4qbe1PvxdwPziTu76SZoOiYDimvhhjUFKC20wrEdfIZy8IEuHRbG6AqTSTzR E3gA== 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=Jca1lAnoEeypqgJ1ikNe6g5ZGRq0Kep10qF1h2a/rBk=; b=Q3odb40g/Tjux6GD+Qa7lO4XuNkeMGIdKEJRJC/PI5ZxQX4zts+RJu97GuO4d7uNW8 mMBJZNhIni88jMQzoitPGza8wJUj3B7PHuIufJuwumc+IF8zvH11qT0ANN12pDXMbNtu hhN+9XSJg54Elgwhry89W4X0IfYoaho2jIFF8FwBg3hCc7Zvo1X52gsdDmecZ+1OZNJU vLjpWVezJ0rOmeNIbewCjEV3Sv9ZtrrUVSg6QfN+QTtvrhWriPkTdRZxxyt24aMRzV4i 68BHHQ8h+c5jjLn3MJrkwYptksIJ/xx3lIJLCS/qt+0iW1mTB5mIT4UBBgAgTj/2LdlA K2yg== X-Gm-Message-State: AODbwcBuJkwdTsqGTJy1gXlVTr55527iCNYB5K48Ri7H2ADS6Zt6UwMb +UkNzYAH1n+orAw8 X-Received: by 10.223.164.80 with SMTP id e16mr33317661wra.100.1497008505872; Fri, 09 Jun 2017 04:41:45 -0700 (PDT) Received: from bgdev-debian.lan (dynamic-194-228-20-36.ipv4.broadband.iol.cz. [194.228.20.36]) by smtp.gmail.com with ESMTPSA id r186sm1237510wmr.30.2017.06.09.04.41.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Jun 2017 04:41:45 -0700 (PDT) From: Bartosz Golaszewski To: Andy Shevchenko , Linus Walleij , Alexandre Courbot , Bamvor Jian Zhang Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v3 5/8] gpio: mockup: don't return magic numbers from probe() Date: Fri, 9 Jun 2017 13:41:29 +0200 Message-Id: <1497008492-14907-6-git-send-email-brgl@bgdev.pl> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1497008492-14907-1-git-send-email-brgl@bgdev.pl> References: <1497008492-14907-1-git-send-email-brgl@bgdev.pl> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When the requested number of GPIO lines is 0, return -EINVAL, not -1 which is -EPERM. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-mockup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index 0cb6cba..ab2d38e 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -369,7 +369,7 @@ static int gpio_mockup_probe(struct platform_device *pdev) ret = gpio_mockup_add(dev, &chips[i], chip_name, base, ngpio); } else { - ret = -1; + ret = -EINVAL; } if (ret) {