Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6809071imu; Mon, 3 Dec 2018 03:14:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ubx0Y1eVNDzEL3EGD8/pTQS6Xcj1pZSWtLODgXq77ID87eUtb/fpqeU1FCP+viA3FMs8z4 X-Received: by 2002:a17:902:b83:: with SMTP id 3mr4249797plr.42.1543835664643; Mon, 03 Dec 2018 03:14:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543835664; cv=none; d=google.com; s=arc-20160816; b=C6vGjUXv5/AD+U88mkFhXQf+jPSguGqapLHe1f1ev1CU76SGl9bUZjySiHan07Dq03 YPb8gTM5cHJjniaRc4OO1J29VSLbq+qgstwCgWgH11OIdxQ58xhCfFqw2SHNG9UA7V/V UJs8C4GqsE5HfH2qImv2t7NXIMJxmfPkBN0ydFAs2RVxg3Y69OH1iaHo9fdSIJHFYEM3 Qa6cqUOKhDNxqYu/JEoRTEyrjzsdbzQzCOfDrpOyuaCQ4+voT6XAy6S0H2vD/JwTmVTc 6+n3LDzUOseugPijI/aamyMuC5Uc+gEuKWX6ycwxfdcgq9rP/qox8Mkj4F97hRPcuKU1 eAtQ== 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=e+uv8HsdUxKrmHY756hkV1EZmXNt3QLT6Xjyt7zcwPQ=; b=ShCheablMKh9WTCLLBVjA+8qB7Q0B6pyAb9K6rgPBym68d0v+hlWQOCVWU0PBzcgYy FRar9HOBzLVew02VVhDpCxLZwdm0TlaTuVjw2hxJab3wVf01J9iIz8zLJnT41E1WrDUS y0GHpcrk1h49kkTBMO60vA311ATAzip18j4vBzQepmXaveLLbzyhK/QXqBzQV3CpxFzt 6/+v0Gfsy9FooL0LhHf17RzbBCnbYaygK22zWKsywLX9EtnPYYAbB152zBm+Yg83Hqc+ ezYVX96UpYINURPoHr4k/Bb3Sric/D5NxMCzejm62phd5ibWeRjXSln8ROVhn7g8USp7 tNZg== 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 bh12si10982650plb.353.2018.12.03.03.14.10; Mon, 03 Dec 2018 03:14:24 -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 S1726361AbeLCLOD (ORCPT + 99 others); Mon, 3 Dec 2018 06:14:03 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:47716 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725907AbeLCLOD (ORCPT ); Mon, 3 Dec 2018 06:14:03 -0500 Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 03 Dec 2018 20:13:26 +0900 Received: from vbox.ree.adwin.renesas.com (unknown [10.226.37.67]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 73562402D031; Mon, 3 Dec 2018 20:13:24 +0900 (JST) From: Phil Edworthy To: Michael Turquette , Stephen Boyd , Russell King Cc: Andy Shevchenko , Geert Uytterhoeven , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Phil Edworthy Subject: [PATCH v9 1/2] clk: Add comment about __of_clk_get_by_name() error values Date: Mon, 3 Dec 2018 11:13:08 +0000 Message-Id: <20181203111309.3709-2-phil.edworthy@renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181203111309.3709-1-phil.edworthy@renesas.com> References: <20181203111309.3709-1-phil.edworthy@renesas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's not immediately obvious from the code that failure to get a clock provider can return either -ENOENT or -EINVAL. Therefore, add a comment to highlight this. Signed-off-by: Phil Edworthy --- drivers/clk/clkdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 9ab3db8b3988..cc5df3970cd3 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -52,6 +52,12 @@ struct clk *of_clk_get(struct device_node *np, int index) } EXPORT_SYMBOL(of_clk_get); +/* + * Beware the return values when np is valid, but no clock provider is found. + * If name = NULL, the function returns -ENOENT. + * If name != NULL, the function returns -EINVAL. This is because __of_clk_get() + * is called even if of_property_match_string() returns an error. + */ static struct clk *__of_clk_get_by_name(struct device_node *np, const char *dev_id, const char *name) -- 2.17.1