From patchwork Wed May 25 11:14:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 68576 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1148380qge; Wed, 25 May 2016 04:13:37 -0700 (PDT) X-Received: by 10.66.87.198 with SMTP id ba6mr4836630pab.151.1464174817095; Wed, 25 May 2016 04:13:37 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si17126110pfi.230.2016.05.25.04.13.36; Wed, 25 May 2016 04:13:37 -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=@nifty.com; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752236AbcEYLNf (ORCPT + 4 others); Wed, 25 May 2016 07:13:35 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:24096 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbcEYLNe (ORCPT ); Wed, 25 May 2016 07:13:34 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u4PBD2wq023611; Wed, 25 May 2016 20:13:02 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u4PBD2wq023611 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1464174783; bh=hy/jvT9eZvIQcEP8jH9SqIQwTtaD0VFBZS1DvUzqDzs=; h=From:To:Cc:Subject:Date:From; b=WBNLMVOrovx0hlLSngtuurv1JhPUPV8GSwCf/SOi2Rh7Y+C1Qnbldn5B9cfKOsw1W iToB3R9Om2qXge5LE5vjIDQoOivXQt5gRVpD1BMNnRUUvEW5YDvkUnAGxlNR7Qv1rt 5jSWhbMjRvaPk3h4/QDG8pniGMgXIpm5K09U/ofQ4PwUKRNkjgrvXTVcONtUn3opwW 8XMEfWI/Xvk0I6vj3bj4JVWeRhVksl/CmhdhTX+DlOIG30knf0267TCph8PA4hNQ0s cuqn4wLbF9f5LOyH61mIChjqAbfUdVbsMOIBl1ckj5kEVhDu7DoX4gFZjRysbl+a1y 9U+M56YzWvTZw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-gpio@vger.kernel.org Cc: Masahiro Yamada , Linus Walleij , linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure Date: Wed, 25 May 2016 20:14:13 +0900 Message-Id: <1464174853-9297-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org -ENOMEM is more suitable error code because kasprintf() fails in case of memory shortage. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/pinmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 -- 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/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index d94d76c..ece7028 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -256,7 +256,7 @@ int pinmux_request_gpio(struct pinctrl_dev *pctldev, /* Conjure some name stating what chip and pin this is taken by */ owner = kasprintf(GFP_KERNEL, "%s:%d", range->name, gpio); if (!owner) - return -EINVAL; + return -ENOMEM; ret = pin_request(pctldev, pin, owner, range); if (ret < 0)