From patchwork Thu May 25 08:33:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 766881 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 3wYMyh158kz9s65 for ; Thu, 25 May 2017 18:35:08 +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="i/vLwzCV"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937368AbdEYIeQ (ORCPT ); Thu, 25 May 2017 04:34:16 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37817 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937750AbdEYIeF (ORCPT ); Thu, 25 May 2017 04:34:05 -0400 Received: by mail-wm0-f46.google.com with SMTP id d127so88787077wmf.0 for ; Thu, 25 May 2017 01:34:04 -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=Y2UQE7z4+Vc55fJv6rz2Ast/My4gXBIrrNUYEhF2j4c=; b=i/vLwzCVMlWrsBfzUqO4nt/NRPzZDAlf9qtZMDgoz/7j3jyHEcgOsj41Chlz1QtGjO 5WuLf9QjsrNDMlgBmDXKdRD6p3AXEtM4x29JKnCtC57RWj5eu92N12v0mPAPrg5ddzMR s9cF0so6T8O6FiGHJNRjsC6ENQjKmCnqihcmNT3BftCs04eZAKP8CRAQ7U39rDqjktQ3 wBEKBmLxEyLqbuy4oEunGfYsqgUrupW7ZoJlk1anIQBgN5m9cx/ZF0MiWM0wpvLPa1T6 OrgMq9W1/Rfp8CHL8Fr2zW1R+cCyrnkyE/bSMFiUWo7rjwU7ScJYZwKGfdW+z9BHLctZ deHw== 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=Y2UQE7z4+Vc55fJv6rz2Ast/My4gXBIrrNUYEhF2j4c=; b=YvB3NjvDjYu8a6eHG5APHPyjuZjrDYD0MDU5qg3ixQRxbWofFQQKwaOLcvaIyNe2uZ S3xCvfoNYrllFjyC37qIUcj/qVvOAlZOH2oUXq5heULYH/VrRMR2FFx5U2llwXRaDqKW ThBkG5Z3Pog1qto1b2xYijtJ05HB6o0bRlLsC+CCTsXK0oEZOCPmq9OR36wXbnewGNZB YKa7WScGUrLVQjSo3RVI4iulQJaXRIO931vdVvTZjBY+R3LvJddAjlDzRaDvNG1QkBxD LfC+xfQdX3CE1B5TrxSHkrD7o3PnihhHrJmFqCEz3cIRAHVd+n79vubUYQ4Kmj1xizOe gO1A== X-Gm-Message-State: AODbwcB6tp2L1YOe+US02UPBZivBR+zKt3ZSXwlkd7ihHxq3V23AMXXQ oiyhnOKu8qV0sgur X-Received: by 10.28.94.78 with SMTP id s75mr8652272wmb.4.1495701243641; Thu, 25 May 2017 01:34:03 -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 m38sm8933813wrm.4.2017.05.25.01.34.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 May 2017 01:34:03 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Alexandre Courbot , Bamvor Jian Zhang Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 08/10] gpio: mockup: don't return magic numbers from probe() Date: Thu, 25 May 2017 10:33:45 +0200 Message-Id: <1495701227-28809-9-git-send-email-brgl@bgdev.pl> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1495701227-28809-1-git-send-email-brgl@bgdev.pl> References: <1495701227-28809-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 f6efa97..3ffc3ce 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -381,7 +381,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) {