Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp575956imu; Fri, 16 Nov 2018 07:02:33 -0800 (PST) X-Google-Smtp-Source: AJdET5cxi3IXu9ZdbVDY4HFgBpYxmbZQ8pgyZNNG0dVbxr7d5ZGLRk52w1Sluoqn51zwtEYuo0hZ X-Received: by 2002:a63:1904:: with SMTP id z4mr9962348pgl.135.1542380553008; Fri, 16 Nov 2018 07:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542380552; cv=none; d=google.com; s=arc-20160816; b=SfXYtVzvW7+sTeLSmTt8Mf05qcpR1eTh+Cz7/X0+ihkPx5CFxGQ0BxsFJuCz0+9SM/ Mif3XuRRKIAQTutbsmejQ7GeeuDS7fCv1ukAtzeh1QXj6/rqYx5kUxy925NleFuK0VrY cq+FfbwYopCpZwM8TJtskKSztraVJTs2/mVxatniZjLccTNTAXz2gGwCAKej7tNvObsW do+WnqdEIzueKl+Ohcv3g87sg/rSPPJFRjKbKmoMidGuqpJU4Hn3Ud2En6KaUCkEPOnM RXnL/v7mDha6INXSP0hH/tZ6LcrAYiUARjqNJR4r0dQ5DsvzyhJyuBjkqL3oxK+ILmCH c0Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from; bh=s13EqxK9cizi0WwyakSSmZN0pAEbuX+x/b5NBHxXdgs=; b=qY6MD1JzaQik353EX9tGDb24VI2CmYiamckrtu44zclUAuEn3nXkM6HZrOH2gX24WM EvzVISpwAfg4LhXdece1wpbDNkl58DtH1yDnMq9UqUY3DbpGmGb0GEeRJ4XFbsHBBq+Z 9DN3fI0VhYtJI3W0+wWIuxNqIKdW5zHo0YfOrjTuvHkpb6LhPDVtBiRGsMjWB4JKUmCk YJMzDWMqVWgRDFBVSadIvCPn8TtkSXaF9NTxSoQWUf/kWCOQ2wCyM4F4RjNjE/gEqI8y BT4HWkcBXDspMTR8lTblAgXI0bOgEjU1Ud3c1h5eXt348JVZP0fMVzv3NczWKEu8GGJB d6Ag== 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 s82-v6si33968819pfk.197.2018.11.16.07.02.18; Fri, 16 Nov 2018 07:02:32 -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 S2390062AbeKQBNq (ORCPT + 99 others); Fri, 16 Nov 2018 20:13:46 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:40271 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728425AbeKQBNp (ORCPT ); Fri, 16 Nov 2018 20:13:45 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie6.idc.renesas.com with ESMTP; 17 Nov 2018 00:01:01 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 3C3DF100374; Sat, 17 Nov 2018 00:01:01 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.56,240,1539615600"; d="scan'208";a="297674605" 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:59 +0900 From: Phil Edworthy Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Phil Edworthy , Guan Xuetao Subject: [PATCH v6 6/6] arch/unicore32/kernel/clock.c: Add clk_get_optional() function Date: Fri, 16 Nov 2018 14:59:37 +0000 Message-Id: <20181116145937.27660-7-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> To: unlisted-recipients:; (no To-header on input) 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/unicore32/kernel/clock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/unicore32/kernel/clock.c b/arch/unicore32/kernel/clock.c index b1ca775f6f6e..03def0b43192 100644 --- a/arch/unicore32/kernel/clock.c +++ b/arch/unicore32/kernel/clock.c @@ -74,6 +74,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