Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700AbbBETJd (ORCPT ); Thu, 5 Feb 2015 14:09:33 -0500 Received: from sauhun.de ([89.238.76.85]:37705 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbbBETJc (ORCPT ); Thu, 5 Feb 2015 14:09:32 -0500 From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Russell King Subject: [PATCH] clk: return proper ERR_PTR for clk_get when !HAVE_CLK Date: Thu, 5 Feb 2015 20:09:22 +0100 Message-Id: <1423163365-15267-1-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1133 Lines: 36 clk_get functions return an ERR_PTR and not NULL in the error case. Make that consistent for the dummy functions when HAVE_CLK is not enabled. Otherwise unexpected codepaths might be trying to use a NULL pointer. Signed-off-by: Wolfram Sang --- include/linux/clk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/clk.h b/include/linux/clk.h index c7f258a81761..37a286b69943 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -340,12 +340,12 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id); static inline struct clk *clk_get(struct device *dev, const char *id) { - return NULL; + return ERR_PTR(-ENOENT); } static inline struct clk *devm_clk_get(struct device *dev, const char *id) { - return NULL; + return ERR_PTR(-ENOENT); } static inline void clk_put(struct clk *clk) {} -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/