All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Linus Walleij" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: clg@kaod.org, Joel Stanley <joel@jms.id.au>,
	Linus Walleij <linus.walleij@linaro.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] clocksource/drivers/fttmr010: Pass around less pointers
Date: Thu, 26 Aug 2021 16:25:15 -0000	[thread overview]
Message-ID: <162999511541.25758.7227260079640777012.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210724224424.2085404-1-linus.walleij@linaro.org>

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     3a95de59730eb9ac8dd6a367018f5653a873ecaa
Gitweb:        https://git.kernel.org/tip/3a95de59730eb9ac8dd6a367018f5653a873ecaa
Author:        Linus Walleij <linus.walleij@linaro.org>
AuthorDate:    Sun, 25 Jul 2021 00:44:23 +02:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Sat, 14 Aug 2021 10:49:49 +02:00

clocksource/drivers/fttmr010: Pass around less pointers

Just pass bool flags from the different initcalls and use the
flags to set the right pointers. This results in less pointers
passed around in init.

Cc: Cédric Le Goater <clg@kaod.org>
Cc: Joel Stanley <joel@jms.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210724224424.2085404-1-linus.walleij@linaro.org
---
 drivers/clocksource/timer-fttmr010.c | 32 +++++++++++++--------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c
index edb1d5f..126fb1f 100644
--- a/drivers/clocksource/timer-fttmr010.c
+++ b/drivers/clocksource/timer-fttmr010.c
@@ -271,9 +271,7 @@ static irqreturn_t ast2600_timer_interrupt(int irq, void *dev_id)
 }
 
 static int __init fttmr010_common_init(struct device_node *np,
-		bool is_aspeed,
-		int (*timer_shutdown)(struct clock_event_device *),
-		irq_handler_t irq_handler)
+				       bool is_aspeed, bool is_ast2600)
 {
 	struct fttmr010 *fttmr010;
 	int irq;
@@ -374,8 +372,6 @@ static int __init fttmr010_common_init(struct device_node *np,
 				     fttmr010->tick_rate);
 	}
 
-	fttmr010->timer_shutdown = timer_shutdown;
-
 	/*
 	 * Setup clockevent timer (interrupt-driven) on timer 1.
 	 */
@@ -383,8 +379,18 @@ static int __init fttmr010_common_init(struct device_node *np,
 	writel(0, fttmr010->base + TIMER1_LOAD);
 	writel(0, fttmr010->base + TIMER1_MATCH1);
 	writel(0, fttmr010->base + TIMER1_MATCH2);
-	ret = request_irq(irq, irq_handler, IRQF_TIMER,
-			  "FTTMR010-TIMER1", &fttmr010->clkevt);
+
+	if (is_ast2600) {
+		fttmr010->timer_shutdown = ast2600_timer_shutdown;
+		ret = request_irq(irq, ast2600_timer_interrupt,
+				  IRQF_TIMER, "FTTMR010-TIMER1",
+				  &fttmr010->clkevt);
+	} else {
+		fttmr010->timer_shutdown = fttmr010_timer_shutdown;
+		ret = request_irq(irq, fttmr010_timer_interrupt,
+				  IRQF_TIMER, "FTTMR010-TIMER1",
+				  &fttmr010->clkevt);
+	}
 	if (ret) {
 		pr_err("FTTMR010-TIMER1 no IRQ\n");
 		goto out_unmap;
@@ -432,23 +438,17 @@ out_disable_clock:
 
 static __init int ast2600_timer_init(struct device_node *np)
 {
-	return fttmr010_common_init(np, true,
-			ast2600_timer_shutdown,
-			ast2600_timer_interrupt);
+	return fttmr010_common_init(np, true, true);
 }
 
 static __init int aspeed_timer_init(struct device_node *np)
 {
-	return fttmr010_common_init(np, true,
-			fttmr010_timer_shutdown,
-			fttmr010_timer_interrupt);
+	return fttmr010_common_init(np, true, false);
 }
 
 static __init int fttmr010_timer_init(struct device_node *np)
 {
-	return fttmr010_common_init(np, false,
-			fttmr010_timer_shutdown,
-			fttmr010_timer_interrupt);
+	return fttmr010_common_init(np, false, false);
 }
 
 TIMER_OF_DECLARE(fttmr010, "faraday,fttmr010", fttmr010_timer_init);

      parent reply	other threads:[~2021-08-26 16:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 22:44 [PATCH 1/2] clocksource/drivers/fttmr010: Pass around less pointers Linus Walleij
2021-07-24 22:44 ` [PATCH 2/2] clocksource/drivers/fttmr010: Be stricter on IRQs Linus Walleij
2021-08-20  8:53   ` Daniel Lezcano
2021-08-20 13:39     ` Linus Walleij
2021-08-20 14:16       ` Daniel Lezcano
2021-08-21  4:20   ` Guenter Roeck
2021-08-21  8:04     ` Daniel Lezcano
2021-08-27 22:01     ` Linus Walleij
2021-08-27 22:31       ` Guenter Roeck
2021-08-28  3:37       ` Guenter Roeck
2021-08-28  8:08         ` Cédric Le Goater
2021-08-30  4:16           ` Andrew Jeffery
2021-08-30  4:58             ` [PATCH 2/2]: Be stric clocksource/drivers/fttmr010ter " Guenter Roeck
2021-08-30  6:30               ` Andrew Jeffery
2021-08-30  7:47               ` [PATCH 2/2]: Be stric clocksource/drivers/fttmr010 " Cédric Le Goater
2021-08-30 15:24                 ` Guenter Roeck
2021-09-01 23:38           ` [PATCH 2/2] clocksource/drivers/fttmr010: Be stricter " Joel Stanley
2021-08-26 16:25 ` tip-bot2 for Linus Walleij [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=162999511541.25758.7227260079640777012.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=clg@kaod.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=joel@jms.id.au \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.