From patchwork Thu Dec 21 14:39:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 122573 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp975619qgn; Thu, 21 Dec 2017 06:39:45 -0800 (PST) X-Google-Smtp-Source: ACJfBovao43ENN7bxPDg1vuknEY+f4vMOhFCb7fqGgWeSdI0H0n/E5E1FTbyc851HbetXYjTra7R X-Received: by 10.159.205.135 with SMTP id v7mr10665861plo.371.1513867185490; Thu, 21 Dec 2017 06:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513867185; cv=none; d=google.com; s=arc-20160816; b=oq130JgZLNEJt+w3gm8yZyPodt/SXYMbWGekKl5H5Jw7qCpHMHEOWSeH6EDs2VFMKN 8HF7KVaS9o3Q4nzGOfHx5znxJxeqxoAc4rZP/6QXzN1sKK1jBHuKm5KVqYKUubS1K6XF 1RrCFMybKKsOmRHQl31PRmQFIosHhlwh/Z4xXR82X1WCVfot7nfDQaOCcwTtO+A3jdA8 5Oty8b/DB2xutBOXaH5m29gXVsxQ1dk2OJvvQFH9NzbBoX/Hbe3IM3Gh9EnlllB/CK0I LmYPj71CvlL1Fj2Jt3A99Xn31aTK9glFx85EkgxWKYdR+v3IK/uoNBQP/+n6i2DhM/9T dJ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=IVQaqwbxR1fDeDz1QidnqgoKkiNpgkC+wjXwfvimFDM=; b=udWuD/G+OEfRLlGXG5itFkkNcmB8zyvBWZlCBXW5kEH2FlQqfFPdtBqimRSiCaRBj7 FiEadT8/oih5tab1jFMEQvnyGkPyitjEtngLrKlxTDeCJqPI3xmaSfDxwM3KK66+mHkZ clTA2PDhfKbIAu65LyzQK20dlQmhmfnmExUwXxMNnlduPROILOWkU3PtnIFoKcNa05cd LaFtaIQG5ilypB2NooefUt8huR4SlU7eG/8OuyB5BQoJxqvhGDAnkKpOWGJFz79AzcL+ h0ymcmaALUQv36uc2X62v7KjKuXzVsF+LlT/HhAS7UHal/V44Z4sBKmB8koDt8dYfEkm RjkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ygbj9fdz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e28si4410910pgn.456.2017.12.21.06.39.45; Thu, 21 Dec 2017 06:39:45 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Ygbj9fdz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752351AbdLUOjm (ORCPT + 28 others); Thu, 21 Dec 2017 09:39:42 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:44054 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751973AbdLUOjh (ORCPT ); Thu, 21 Dec 2017 09:39:37 -0500 Received: by mail-wr0-f193.google.com with SMTP id l41so13158604wre.11 for ; Thu, 21 Dec 2017 06:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=IVQaqwbxR1fDeDz1QidnqgoKkiNpgkC+wjXwfvimFDM=; b=Ygbj9fdztizAZVJQrWTdnfxXlTbejNSjpeDTyLxidF2LGFiwszWheUYRjGuZipiRyg wTIK70XHr7eyFpzXpqKJEMMPUxxEcZU9RR0LN11/f+Pq6H4G8b6JBX2jqzal1EThhRem 3neUwh1sKstVqw5uYf8hJYsl8Mw171+FiBAv4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IVQaqwbxR1fDeDz1QidnqgoKkiNpgkC+wjXwfvimFDM=; b=LTUXcInS+01F+IjaMvVzvOJ7auF8fx2EXgXR6vukFLfz4qgyco8G4MEejamVAwxxV6 66fUFYLd4MGIsiQsYhBxr98yaoFQYMfSG8497cOHf+H2qSMktWRo+Oy3wW6EfpK3ZWMo 0H9Oy6A/N2B5wdsdygJHJaZ9w7ETRXyjpmIoHbPmw1BPgvGr/QfmqgGC44fWfZ1fngUI rQR3ssur5MP+WJKWAGGgLCrDrCVKJkH8fQxH9hZhAUQA0S6J3L8BNO5vx9rGLPpfUT4m DeGShTLxx6gHZtT44JgXzwEssgJHkPyoovCvsAJNnVyp1Ci5P8Q3qC7IB8RQrJQBbZEW 192A== X-Gm-Message-State: AKGB3mJbeQlrul7yBEmqDwqb10HNyu5ipVWH1+nYWui1lRTytkBNEYq2 vxufGWwaSDbAU2VKMMBiJAEklA== X-Received: by 10.223.191.2 with SMTP id p2mr145201wrh.81.1513867176062; Thu, 21 Dec 2017 06:39:36 -0800 (PST) Received: from mai.localdomain ([2a01:e35:879a:6cd0:3e97:eff:fe5b:1402]) by smtp.gmail.com with ESMTPSA id f90sm7311815wmh.12.2017.12.21.06.39.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Dec 2017 06:39:35 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: Thomas Gleixner , linux-kernel@vger.kernel.org (open list:CLOCKSOURCE, CLOCKEVENT DRIVERS) Subject: [PATCH 1/2] clocksource/drivers/timer-of: Fix function names Date: Thu, 21 Dec 2017 15:39:19 +0100 Message-Id: <1513867161-19104-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All the functions are not prefixed with 'timer_of_', fix the naming in order to have the code consistent. Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-of.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) -- 2.7.4 diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index a319904..ad55654 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -24,7 +24,7 @@ #include "timer-of.h" -static __init void timer_irq_exit(struct of_timer_irq *of_irq) +static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) { struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); @@ -34,8 +34,8 @@ static __init void timer_irq_exit(struct of_timer_irq *of_irq) free_irq(of_irq->irq, clkevt); } -static __init int timer_irq_init(struct device_node *np, - struct of_timer_irq *of_irq) +static __init int timer_of_irq_init(struct device_node *np, + struct of_timer_irq *of_irq) { int ret; struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); @@ -72,15 +72,15 @@ static __init int timer_irq_init(struct device_node *np, return 0; } -static __init void timer_clk_exit(struct of_timer_clk *of_clk) +static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) { of_clk->rate = 0; clk_disable_unprepare(of_clk->clk); clk_put(of_clk->clk); } -static __init int timer_clk_init(struct device_node *np, - struct of_timer_clk *of_clk) +static __init int timer_of_clk_init(struct device_node *np, + struct of_timer_clk *of_clk) { int ret; @@ -116,13 +116,13 @@ static __init int timer_clk_init(struct device_node *np, goto out; } -static __init void timer_base_exit(struct of_timer_base *of_base) +static __init void timer_of_base_exit(struct of_timer_base *of_base) { iounmap(of_base->base); } -static __init int timer_base_init(struct device_node *np, - struct of_timer_base *of_base) +static __init int timer_of_base_init(struct device_node *np, + struct of_timer_base *of_base) { const char *name = of_base->name ? of_base->name : np->full_name; @@ -141,21 +141,21 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) int flags = 0; if (to->flags & TIMER_OF_BASE) { - ret = timer_base_init(np, &to->of_base); + ret = timer_of_base_init(np, &to->of_base); if (ret) goto out_fail; flags |= TIMER_OF_BASE; } if (to->flags & TIMER_OF_CLOCK) { - ret = timer_clk_init(np, &to->of_clk); + ret = timer_of_clk_init(np, &to->of_clk); if (ret) goto out_fail; flags |= TIMER_OF_CLOCK; } if (to->flags & TIMER_OF_IRQ) { - ret = timer_irq_init(np, &to->of_irq); + ret = timer_of_irq_init(np, &to->of_irq); if (ret) goto out_fail; flags |= TIMER_OF_IRQ; @@ -167,13 +167,13 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) out_fail: if (flags & TIMER_OF_IRQ) - timer_irq_exit(&to->of_irq); + timer_of_irq_exit(&to->of_irq); if (flags & TIMER_OF_CLOCK) - timer_clk_exit(&to->of_clk); + timer_of_clk_exit(&to->of_clk); if (flags & TIMER_OF_BASE) - timer_base_exit(&to->of_base); + timer_of_base_exit(&to->of_base); return ret; } @@ -187,11 +187,11 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to) void __init timer_of_cleanup(struct timer_of *to) { if (to->flags & TIMER_OF_IRQ) - timer_irq_exit(&to->of_irq); + timer_of_irq_exit(&to->of_irq); if (to->flags & TIMER_OF_CLOCK) - timer_clk_exit(&to->of_clk); + timer_of_clk_exit(&to->of_clk); if (to->flags & TIMER_OF_BASE) - timer_base_exit(&to->of_base); + timer_of_base_exit(&to->of_base); } From patchwork Thu Dec 21 14:39:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 122574 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp975710qgn; Thu, 21 Dec 2017 06:39:50 -0800 (PST) X-Google-Smtp-Source: ACJfBouqvNEbxN0um5PKHD9aQef0WDLNlik/avPE4TuVqDAOaQGd5ZoZ3FiFEGqfG5wOVV1BVrWc X-Received: by 10.98.28.210 with SMTP id c201mr10641348pfc.154.1513867190459; Thu, 21 Dec 2017 06:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513867190; cv=none; d=google.com; s=arc-20160816; b=CHU6kYBl8Al5O9kAbo/s4wBEsaVZofvwVpVl1BLcsCjQN+UVSBGKH6il9Vn/cXjx92 +6c6m/h3LAzb6hs9bO5nI+dRcn0bQmH3pHblw8HFRbyWnfjTRnnNrfg6kVZX+IqgUZ3p FDsrUeM/B4i8u4RRymhsDucAw6rlqBsq7YdBkadADbyx8ejlRNvBKj7r19ZlD1EN8Evb 1dDkMKbsfsi9j8GcFQk17bcQBLZIQhqZoZzWQXz/I8oWBaF/iPGwOsHluzElXUcI9Lr8 TX0zFaXNbwagaiS0GkMU4WUa56dwYtTcFfyGa1hjlSK5puHjKXusRWVMo/qwfxFoK+VZ 0RIA== 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:dkim-signature:arc-authentication-results; bh=dSB+IkOqYpOGOVJihNnHQgBmEZMvmwiwduTzEz9K0SU=; b=B27DkxpZI4o9D7tjKqFj/8eA5KOZK9ENJGOZ+CIhm1sBbZvFuvSJMQz21qZnlNDeQW uD42YmmTmy/LCR8HMjLYGy2pGfxgsoekUEB1kTH1WOsECos16MPJklYdSYKsvf1aHCtM /DKfyft/CAS//fL3j3anW/F6X03eZs4fYVHBdYe67pcz4rV8zqqekCI9luK8AeczDV63 X/KKg55wx2sWMxz0R4wjN2SVooumjosr7YU9/3hTaNUCNJmxn8E0FGu8QdbS82jFlhJ8 mifnKHbfAr/5jccyB6rjAVAUSrbps/lG/YtpwxaqDleLNqcmUubtNb8boChiL4ypU1JO 51rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I2Et2PLZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si14873386plq.719.2017.12.21.06.39.50; Thu, 21 Dec 2017 06:39:50 -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; dkim=pass header.i=@linaro.org header.s=google header.b=I2Et2PLZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601AbdLUOjq (ORCPT + 28 others); Thu, 21 Dec 2017 09:39:46 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:37146 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752168AbdLUOji (ORCPT ); Thu, 21 Dec 2017 09:39:38 -0500 Received: by mail-wr0-f196.google.com with SMTP id f8so14577079wre.4 for ; Thu, 21 Dec 2017 06:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dSB+IkOqYpOGOVJihNnHQgBmEZMvmwiwduTzEz9K0SU=; b=I2Et2PLZi8siN1HxWc9dtTELIj5qr60SC90rOH9V+M4QpxL6cfg7lU6egAWhb4xzz2 PjfvlRy7BRto55guKggOAzBj2NCbWFpMBgI+eN/UBxvjU0bmp0ASafL5zCXrVA3LxDem yvcooS3M8qmAlqfu7qzwocdehoQzD2Ag8aJ4I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dSB+IkOqYpOGOVJihNnHQgBmEZMvmwiwduTzEz9K0SU=; b=gxewMtzGJRFGTjcn215cAsCMoKqWwmHlO8xltzylMwq593QC20H4WsqyjH2Pp95w7B Q44/0AB+4oWijU0yOzu66WzBOXO8CYf4qMzpOJBym4zL4HAU7fT71ie2ucImSZOo9ebV HvGIfeKcLTpPz6VBteJ34UXCweA/4N9kWuVII+nUmZdtlviIQ+YafTZQH8ZUzQiByk3p kZOCYWNNfCy9HEfc4rwWTq9uGsRhn/a4Mt/1bq7dvi4V6emPN/T8dfocQueqeO+6zSrl 8/JIimrnepBkoCKXd4p0YhixhfmmaZjm27XmRpMknQSJ0FKFPiZJ1xArpTA61vigTYiD yBoQ== X-Gm-Message-State: AKGB3mKawNjPn9ovca5wR26NkX7jgpVl8ZqNIXghmZyYF1y3mZi7U1pn nKRePpw4SXZbac8iNhRZVRFrBQ== X-Received: by 10.223.160.161 with SMTP id m30mr12726762wrm.91.1513867177633; Thu, 21 Dec 2017 06:39:37 -0800 (PST) Received: from mai.localdomain ([2a01:e35:879a:6cd0:3e97:eff:fe5b:1402]) by smtp.gmail.com with ESMTPSA id f90sm7311815wmh.12.2017.12.21.06.39.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Dec 2017 06:39:37 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: Thomas Gleixner , linux-kernel@vger.kernel.org (open list:CLOCKSOURCE, CLOCKEVENT DRIVERS) Subject: [PATCH 2/2] clocksource/drivers/timer-of: Add kernel documentation Date: Thu, 21 Dec 2017 15:39:20 +0100 Message-Id: <1513867161-19104-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513867161-19104-1-git-send-email-daniel.lezcano@linaro.org> References: <1513867161-19104-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current code has no comment, neither function description. Fix this by adding a kernel doc format for the function description. Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-of.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -- 2.7.4 diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c index ad55654..2af8b8a 100644 --- a/drivers/clocksource/timer-of.c +++ b/drivers/clocksource/timer-of.c @@ -24,6 +24,12 @@ #include "timer-of.h" +/** + * timer_of_irq_exit - Release the interrupt + * @of_irq: an of_timer_irq structure pointer + * + * Free the irq resource + */ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) { struct timer_of *to = container_of(of_irq, struct timer_of, of_irq); @@ -34,6 +40,22 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq) free_irq(of_irq->irq, clkevt); } +/** + * timer_of_irq_init - Request the interrupt + * @np: a device tree node pointer + * @of_irq: an of_timer_irq structure pointer + * + * Get the interrupt number from the DT from its definition and + * request it. The interrupt is get by fallbacking as follow: + * + * - Get interrupt number by name + * - Get interrupt number by index + * + * When the interrupt is per cpu, 'request_percpu_irq' is called + * otherwise, 'request_irq' is used. + * + * Returns 0 on success, < 0 otherwise + */ static __init int timer_of_irq_init(struct device_node *np, struct of_timer_irq *of_irq) { @@ -72,6 +94,13 @@ static __init int timer_of_irq_init(struct device_node *np, return 0; } +/** + * timer_of_clk_exit - Release the clock resources + * @of_clk: a of_timer_clk structure pointer + * + * Disables and release the refcount on the clk + * + */ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) { of_clk->rate = 0; @@ -79,6 +108,15 @@ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk) clk_put(of_clk->clk); } +/** + * timer_of_clk_init - Initialize the clock resources + * @np: a device tree node pointer + * @of_clk: a of_timer_clk structure pointer + * + * Get the clock by name or by index, enables it and get the rate + * + * Returns 0 on success, < 0 otherwise + */ static __init int timer_of_clk_init(struct device_node *np, struct of_timer_clk *of_clk) {