From patchwork Sat Nov 4 03:38:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 117969 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp455144qgn; Fri, 3 Nov 2017 20:38:39 -0700 (PDT) X-Google-Smtp-Source: ABhQp+REzBhPlo6RU7J5yjaeT5wG8yi36wnRMG6V+rBYsAu6W7ckf7GKf/C+19yMLt10LaDAKkAx X-Received: by 10.84.163.75 with SMTP id n11mr8569629plg.287.1509766719042; Fri, 03 Nov 2017 20:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509766719; cv=none; d=google.com; s=arc-20160816; b=REGtw3/YAH7MnVW8K1jIK0H2bS7rATLLdzhd84K3dFE7+lfwXrG+xr9ry/JvaWtA1Y g6wDTEWc+Tm4OZrjnBDRpUCSKen4Mt8PePL9Jkg5+dOVKIxXQ+uNEqCDwVc+A8PPfIky gQwQ5nknXogzSA3cZ5lnzw4aOetAr6CT2TCYnJLBXDmqZAEbJwSYcW4+aYdo5x6sG+dZ vD6RsEsQRV6DnrgK+JNV6BQaYl/YXMDHyqQa6tyhHllTej54lkHpU/stmoJUDrZYXB5u g05rKt5nJ8y4jtUN4g7qpWqsLY43/x8tZA8p5i8XxmVm0823yWDVYS9PUS0jmJkjQA8b FY3Q== 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=0T063sKcLmiKc4kIpJn1sHSFq0XN5UvOELkKRFxa6jM=; b=0IKfokdqvRbBBseJbeiONmdn7hqzQ53ko2DOlJEbWE3OJ4KdZlAXoHsg5vgv013780 i+srzlkhpJ4FiQ7hVtETNuh9aPE2ZEvegLX0Y0520tSRc5T4rywKZdcgC+u9zlUGLDWL +b+hmhzK7NbrEwmqSVNkdOHA3p7fAVPO5bSh8cjJ6csr8JojydRY/WPP08ltNyJx8XR7 Gxf6Ta1HhMym2hcWDOTrmqIUUFJGdFwfupqfxBeYPO04SnYzRv/XL033KRzw/jSqbz2s IBJ5iPt0lZ27xQtjf9ie3Wq4V/rlBk6QFfyDeCoVeBqnJdSCp5vecAmZKNHKAVB0X/Tv 8wyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGi8i9O9; 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=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 31si5983115plk.332.2017.11.03.20.38.38; Fri, 03 Nov 2017 20:38:39 -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=@linaro.org header.s=google header.b=YGi8i9O9; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049AbdKDDif (ORCPT + 26 others); Fri, 3 Nov 2017 23:38:35 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:49947 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbdKDDid (ORCPT ); Fri, 3 Nov 2017 23:38:33 -0400 Received: by mail-pg0-f66.google.com with SMTP id g6so4001091pgn.6 for ; Fri, 03 Nov 2017 20:38:33 -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=0T063sKcLmiKc4kIpJn1sHSFq0XN5UvOELkKRFxa6jM=; b=YGi8i9O9qdVdlo/LnzqZeGgEMZlmj1R8WTP6/UxRHMn1QlaiUUlApaxLzyVlqr2Ylq 02tLULCpg1b5CiFjZ4/ZOHGzxD/DLdXWm4A2XAAW5xR2r6Lz/zzIe3Npog04B5j9SxO5 RUuZzkxO+OwZ4Zy6TMTbRWkEEyShsw/X3j7CE= 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=0T063sKcLmiKc4kIpJn1sHSFq0XN5UvOELkKRFxa6jM=; b=EH0httlMS3Y/eXEA512rI0icartCRr03OGwJa9fTYJzGQE5zx5LdwNFQh0k8YH13kr 7SLCFpl8ZXh2gcT5J5SmNs+nl4YuwoXcKaIEQLuiLqSyVN6kHTxUrMnSZKQwCUCcb08O jNyTLpkzou4Bf2LojrMDUIynTUDkSVmFzxQUSqV5ZU1JOoggyZxYF5F15fNaMB4qCiW8 idiJVyEMD7cMVgcXL+n8NAsvIEeElariu8TZpugLGv7ZEqTZ418slAn+rR676x1agk8H oJNAtu3mEgPeuiC+0OqV++0KSRUHHU5d9Z5BS/PTeZy7Z07A/yaicttetOhxJwGkcJmT FW0w== X-Gm-Message-State: AMCzsaWny5sZh3Ay6m4HeFw35jdyml3RNTOoz/IeASg9uPsKlkoGZgF3 Hu0qxMCmIgwuDiwSNNi/oWVzLw== X-Received: by 10.101.74.199 with SMTP id c7mr8909125pgu.169.1509766713015; Fri, 03 Nov 2017 20:38:33 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id b22sm13333418pfj.123.2017.11.03.20.38.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 20:38:32 -0700 (PDT) From: Bjorn Andersson To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / devfreq: Propagate error from devfreq_add_device() Date: Fri, 3 Nov 2017 20:38:28 -0700 Message-Id: <20171104033828.16773-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Propagate the error of devfreq_add_device() in devm_devfreq_add_device() rather than statically returning ENOMEM. This makes it slightly faster to pinpoint the cause of a returned error. Signed-off-by: Bjorn Andersson --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.12.0 diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 78fb496ecb4e..99c4021fc33b 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -737,7 +737,7 @@ struct devfreq *devm_devfreq_add_device(struct device *dev, devfreq = devfreq_add_device(dev, profile, governor_name, data); if (IS_ERR(devfreq)) { devres_free(ptr); - return ERR_PTR(-ENOMEM); + return devfreq; } *ptr = devfreq;