Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp575038imu; Fri, 16 Nov 2018 07:01:56 -0800 (PST) X-Google-Smtp-Source: AJdET5fpmnklAsyJPDeXJ0jDOUOx5L1xg4X4Wev428rkX333Sr9DnqeINDxQvFg5tg3gXbmf9hAG X-Received: by 2002:a62:470f:: with SMTP id u15-v6mr11447037pfa.107.1542380516755; Fri, 16 Nov 2018 07:01:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542380516; cv=none; d=google.com; s=arc-20160816; b=iKWmjOi09MlhbgSo/fn+7ZAxZPEgqpPzPUD3aSitqwdV06pQ4zriUf5oswtkaC5W0V 7nsyfR7QylRTfQ+KwRlnwDqlgHczY4xKMDm4/walEqSAIj+zdcWQwBBIZVh1Rnqcm44b BV3zJ6QsVXIpWzWx7KjQrXXlBW2PWgYq2RqXyH7DthdjxyiGDFn61gQDIxT9nw2EhbP7 0LDxcNZfhPAqkgHMoC5m7IgYGIlD/570m64md5ByoYeKk/9rF8oaodnWx1EzZPMmczcQ UDFEu6Iiudm6yGF05bvoFQCz6D+zd92i1uCrQwnlqxPN9iYdJvoCtzLfXlWAEg2eg4FT eB7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=CIjl7r16mctxkAxJR/LrWqEVDFMbzFja8Vm8n6A+9Q4=; b=C+OZPk7D7ldcDE6MbJOoEi0KMskgyx1gfYBdOXQD1d+hEA7aj1ftu1KAMV+Lmb0Tkd gw+m1q4jhy7xH5yfvv7agWQVKOkyfmTK5BiQSNlKArpdPcDSUuhQIfuzjn1y1vz4cRTA T8QkOpTKspkJpLzNwHh5Cy1weCCMLSS9UptFpAK4JMzk57ASgev2C0vEkMmpV8YTkW+P nyxjV9Q/6liurLzjC8+ZNHCbCGynQC13uvN+ZnBTl7Tnm4X9dmMcObwga9p5qRkzikON egkDNgpsyQ+0u7e3EzqQoJWtGLBIExuHFJmcNdm2G9hdJoC4AhvfO/Nb/z50/GqOYswt T3Bg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si30919793pge.384.2018.11.16.07.01.40; Fri, 16 Nov 2018 07:01:56 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390026AbeKQBNX (ORCPT + 99 others); Fri, 16 Nov 2018 20:13:23 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:60899 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389903AbeKQBNX (ORCPT ); Fri, 16 Nov 2018 20:13:23 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie6.idc.renesas.com with ESMTP; 17 Nov 2018 00:00:38 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id C70ECE3B5E; Sat, 17 Nov 2018 00:00:38 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.56,240,1539615600"; d="scan'208";a="297674585" Received: from unknown (HELO vbox.ree.adwin.renesas.com) ([10.226.37.67]) by relmlii2.idc.renesas.com with ESMTP; 17 Nov 2018 00:00:36 +0900 From: Phil Edworthy To: Ralf Baechle Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Phil Edworthy , Paul Burton , James Hogan , Geert Uytterhoeven , linux-mips@linux-mips.org Subject: [PATCH v6 4/6] MIPS: AR7: Add clk_get_optional() function Date: Fri, 16 Nov 2018 14:59:35 +0000 Message-Id: <20181116145937.27660-5-phil.edworthy@renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181116145937.27660-1-phil.edworthy@renesas.com> References: <20181116145937.27660-1-phil.edworthy@renesas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clk_get_optional() returns NULL if not found instead of -ENOENT, otherwise the behaviour is the same as clk_get(). Signed-off-by: Phil Edworthy --- arch/mips/ar7/clock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/mips/ar7/clock.c b/arch/mips/ar7/clock.c index 6b64fd96dba8..b13f763948b1 100644 --- a/arch/mips/ar7/clock.c +++ b/arch/mips/ar7/clock.c @@ -454,6 +454,17 @@ struct clk *clk_get(struct device *dev, const char *id) } EXPORT_SYMBOL(clk_get); +struct clk *clk_get_optional(struct device *dev, const char *id) +{ + struct clk *clk = clk_get(dev, id); + + if (clk == ERR_PTR(-ENOENT)) + clk = NULL; + + return clk; +} +EXPORT_SYMBOL(clk_get_optional); + void clk_put(struct clk *clk) { } -- 2.17.1