All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@treblig.org
To: abbotti@mev.co.uk, hsweeten@visionengravers.com
Cc: linux-kernel@vger.kernel.org,
	"Dr. David Alan Gilbert" <linux@treblig.org>
Subject: [PATCH] comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer
Date: Thu, 10 Oct 2024 21:41:27 +0100	[thread overview]
Message-ID: <20241010204127.271377-1-linux@treblig.org> (raw)

From: "Dr. David Alan Gilbert" <linux@treblig.org>

comedi_8254_ns_to_timer() has been unused since it was added
in commit
d42b5211d861 ("staging: comedi: comedi_8254: introduce module for 8254 timer support")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/comedi/drivers/comedi_8254.c | 37 ----------------------------
 include/linux/comedi/comedi_8254.h   |  2 --
 2 files changed, 39 deletions(-)

diff --git a/drivers/comedi/drivers/comedi_8254.c b/drivers/comedi/drivers/comedi_8254.c
index 6beca2a6d66e..9b7747dab747 100644
--- a/drivers/comedi/drivers/comedi_8254.c
+++ b/drivers/comedi/drivers/comedi_8254.c
@@ -77,10 +77,6 @@
  * to create a 32-bit rate generator (I8254_MODE2). These functions are
  * provided to handle the cascaded counters:
  *
- * comedi_8254_ns_to_timer()
- *	Calculates the divisor value needed for a single counter to generate
- *	ns timing.
- *
  * comedi_8254_cascade_ns_to_timer()
  *	Calculates the two divisor values needed to the generate the pacer
  *	clock (in ns).
@@ -472,39 +468,6 @@ void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
 }
 EXPORT_SYMBOL_GPL(comedi_8254_cascade_ns_to_timer);
 
-/**
- * comedi_8254_ns_to_timer - calculate the divisor value for nanosec timing
- * @i8254:	comedi_8254 struct for the timer
- * @nanosec:	the desired ns time
- * @flags:	comedi_cmd flags
- */
-void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
-			     unsigned int *nanosec, unsigned int flags)
-{
-	unsigned int divisor;
-
-	switch (flags & CMDF_ROUND_MASK) {
-	default:
-	case CMDF_ROUND_NEAREST:
-		divisor = DIV_ROUND_CLOSEST(*nanosec, i8254->osc_base);
-		break;
-	case CMDF_ROUND_UP:
-		divisor = DIV_ROUND_UP(*nanosec, i8254->osc_base);
-		break;
-	case CMDF_ROUND_DOWN:
-		divisor = *nanosec / i8254->osc_base;
-		break;
-	}
-	if (divisor < 2)
-		divisor = 2;
-	if (divisor > I8254_MAX_COUNT)
-		divisor = I8254_MAX_COUNT;
-
-	*nanosec = divisor * i8254->osc_base;
-	i8254->next_div = divisor;
-}
-EXPORT_SYMBOL_GPL(comedi_8254_ns_to_timer);
-
 /**
  * comedi_8254_set_busy - set/clear the "busy" flag for a given counter
  * @i8254:	comedi_8254 struct for the timer
diff --git a/include/linux/comedi/comedi_8254.h b/include/linux/comedi/comedi_8254.h
index d527f04400df..21be0b7250b4 100644
--- a/include/linux/comedi/comedi_8254.h
+++ b/include/linux/comedi/comedi_8254.h
@@ -129,8 +129,6 @@ void comedi_8254_pacer_enable(struct comedi_8254 *i8254,
 void comedi_8254_update_divisors(struct comedi_8254 *i8254);
 void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
 				     unsigned int *nanosec, unsigned int flags);
-void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
-			     unsigned int *nanosec, unsigned int flags);
 
 void comedi_8254_set_busy(struct comedi_8254 *i8254,
 			  unsigned int counter, bool busy);
-- 
2.47.0


             reply	other threads:[~2024-10-10 20:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 20:41 linux [this message]
2024-11-12 21:36 ` [PATCH] comedi: comedi_8254: Remove unused comedi_8254_ns_to_timer Dr. David Alan Gilbert
2025-03-13 14:06   ` Dr. David Alan Gilbert

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=20241010204127.271377-1-linux@treblig.org \
    --to=linux@treblig.org \
    --cc=abbotti@mev.co.uk \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.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.