From patchwork Tue May 31 23:55:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Youn X-Patchwork-Id: 9145825 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC03860752 for ; Tue, 31 May 2016 23:59:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEEB626464 for ; Tue, 31 May 2016 23:59:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C366126701; Tue, 31 May 2016 23:59:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E97026464 for ; Tue, 31 May 2016 23:59:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b7tVR-0005EZ-K3; Tue, 31 May 2016 23:55:29 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b7tVO-0004sR-O8 for linux-arm-kernel@lists.infradead.org; Tue, 31 May 2016 23:55:27 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3E36D209A4; Tue, 31 May 2016 19:55:04 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Tue, 31 May 2016 19:55:04 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:cc:cc:cc:cc:date:from:message-id :subject:to:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=SnY2Qv/pCX6X fcmPGnSpSfdBjq0=; b=atHTGcPu7wNdrhPmlPECPkEv2VVP3xzPP/n3XIdL8cwn ElbSPSL8CkOEDtTnZh+ksBSjrXXbPSzlprjUQo258dIZe9dvb6p314EWekWfJT00 F/MGmojWskLDUSz6GOLn5yRO9D+UGoUEt5rild5TTT9ge8i4fXyzC2yj8lZP4lc= X-Sasl-enc: P5R3vpE5OrYwwXQrmilDf6kwMPb5K9EtBQ+IAPPjQjmo 1464738902 Received: from starbug (us02-cip.synopsys.com [198.182.56.5]) by mail.messagingengine.com (Postfix) with ESMTPA id 3A342F2A57; Tue, 31 May 2016 19:55:02 -0400 (EDT) Received: by starbug (sSMTP sendmail emulation); Tue, 31 May 2016 16:55:01 -0700 Date: Tue, 31 May 2016 16:55:01 -0700 Message-Id: <2b8732d98087e52edec39ec83a063912fcc23962.1464738402.git.johnyoun@synopsys.com> From: John Youn To: Philipp Zabel To: Hans de Goede Subject: [PATCH v2] reset: Return -ENOTSUPP when not configured X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160531_165526_875886_9A8E96D7 X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stefan.wahren@i2se.com, Felipe Balbi , johnyoun@synopsys.com, linux-usb@vger.kernel.org, dinguyen@opensource.altera.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Prior to commit 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers"), the "optional" functions returned -ENOTSUPP when CONFIG_RESET_CONTROLLER was not set. Revert back to the old behavior by changing the new __devm_reset_control_get() and __of_reset_control_get() functions to return ERR_PTR(-ENOTSUPP) when compiled without CONFIG_RESET_CONTROLLER. Otherwise they will return -EINVAL causing users to think that an error occurred when CONFIG_RESET_CONTROLLER is not set. Fixes: 6c96f05c8bb8 ("reset: Make [of_]reset_control_get[_foo] functions wrappers") Signed-off-by: John Youn --- Hi Philipp, Here are the changes as discussed previously. It just returns -ENOTSUPP directly when not configured. Tested and works with DWC2 driver with Dinh's patch that adds the reset controller, using a configuration with no reset controller configured. v2: * Return ERR_PTR(-ENOTSUPP) directly. include/linux/reset.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/reset.h b/include/linux/reset.h index ec0306ce..067db57 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -71,14 +71,14 @@ static inline struct reset_control *__of_reset_control_get( struct device_node *node, const char *id, int index, int shared) { - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOTSUPP); } static inline struct reset_control *__devm_reset_control_get( struct device *dev, const char *id, int index, int shared) { - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOTSUPP); } #endif /* CONFIG_RESET_CONTROLLER */