Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762768AbdDSLtO (ORCPT ); Wed, 19 Apr 2017 07:49:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49710 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762617AbdDSLtL (ORCPT ); Wed, 19 Apr 2017 07:49:11 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 09F806114D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vivek.gautam@codeaurora.org Subject: Re: [PATCH V3 1/4] reset: Add API to count number of reset available with device To: Philipp Zabel References: <1492514488-27385-1-git-send-email-vivek.gautam@codeaurora.org> <1492514488-27385-2-git-send-email-vivek.gautam@codeaurora.org> <1492597532.2970.61.camel@pengutronix.de> Cc: swarren@wwwdotorg.org, balbi@kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org, thierry.reding@gmail.com, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org From: Vivek Gautam Message-ID: <0e3ba304-6086-63dd-3ba9-f6a4e40dc33c@codeaurora.org> Date: Wed, 19 Apr 2017 17:19:04 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1492597532.2970.61.camel@pengutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1722 Lines: 62 On 04/19/2017 03:55 PM, Philipp Zabel wrote: > On Tue, 2017-04-18 at 16:51 +0530, Vivek Gautam wrote: >> Count number of reset phandles available with the device node >> to know the resets a given device has. >> >> Cc: Philipp Zabel >> Signed-off-by: Vivek Gautam >> --- >> drivers/reset/core.c | 23 +++++++++++++++++++++++ >> include/linux/reset.h | 6 ++++++ >> 2 files changed, 29 insertions(+) >> >> diff --git a/drivers/reset/core.c b/drivers/reset/core.c >> index cd739d2fa160..f0a06a7aca93 100644 >> --- a/drivers/reset/core.c >> +++ b/drivers/reset/core.c >> @@ -465,3 +465,26 @@ int device_reset(struct device *dev) >> return ret; >> } >> EXPORT_SYMBOL_GPL(device_reset); >> + >> +/** >> + * of_reset_control_get_count - Count number of resets available with a device >> + * >> + * @node: device node that contains 'resets'. >> + * >> + * Returns positive reset count on success, or error number on failure and >> + * on count being zero. >> + */ >> +int of_reset_control_get_count(struct device_node *node) >> +{ >> + int count; >> + >> + if (!node) >> + return -EINVAL; >> + >> + count = of_count_phandle_with_args(node, "resets", "#reset-cells"); >> + if (count == 0) >> + count = -ENOENT; >> + >> + return count; >> +} >> +EXPORT_SYMBOL_GPL(of_reset_control_get_count); > This doesn't need to be public anymore. You can make it static and merge > it into the second patch. Thanks for reviewing the series. Sure, make sense to make it static and squash in the second patch. Best Regards Vivek > > regards > Philipp > -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project