linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: driverdev-devel@linuxdriverproject.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hartleys@visionengravers.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 18/28] staging: comedi: amplc_pci230: add `pci230_` prefix to functions
Date: Mon,  1 Sep 2014 12:03:50 +0100	[thread overview]
Message-ID: <1409569440-10979-19-git-send-email-abbotti@mev.co.uk> (raw)
In-Reply-To: <1409569440-10979-1-git-send-email-abbotti@mev.co.uk>

Most functions in "amplc_pci230" are named with the prefix `pci230_`,
apart from one or two that have the prefix `amplc_pci230_` and a few
odd-balls with no particular prefix.  Rename the ones without a prefix
for consistency.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/amplc_pci230.c | 41 ++++++++++++++-------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c
index 72da4b6..6cd235d 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -613,8 +613,8 @@ static void pci230_ao_write_fifo(struct comedi_device *dev,
 	     devpriv->daqio + PCI230P2_DACDATA);
 }
 
-static int get_resources(struct comedi_device *dev, unsigned int res_mask,
-			 unsigned char owner)
+static int pci230_get_resources(struct comedi_device *dev,
+				unsigned int res_mask, unsigned char owner)
 {
 	struct pci230_private *devpriv = dev->private;
 	int ok;
@@ -649,14 +649,14 @@ static int get_resources(struct comedi_device *dev, unsigned int res_mask,
 	return ok;
 }
 
-static int get_one_resource(struct comedi_device *dev,
-			    unsigned int resource, unsigned char owner)
+static int pci230_get_one_resource(struct comedi_device *dev,
+				   unsigned int resource, unsigned char owner)
 {
-	return get_resources(dev, 1U << resource, owner);
+	return pci230_get_resources(dev, 1U << resource, owner);
 }
 
-static void put_resources(struct comedi_device *dev, unsigned int res_mask,
-			  unsigned char owner)
+static void pci230_put_resources(struct comedi_device *dev,
+				 unsigned int res_mask, unsigned char owner)
 {
 	struct pci230_private *devpriv = dev->private;
 	unsigned int i;
@@ -674,19 +674,20 @@ static void put_resources(struct comedi_device *dev, unsigned int res_mask,
 	spin_unlock_irqrestore(&devpriv->res_spinlock, irqflags);
 }
 
-static void put_one_resource(struct comedi_device *dev,
-			     unsigned int resource, unsigned char owner)
+static void pci230_put_one_resource(struct comedi_device *dev,
+				    unsigned int resource, unsigned char owner)
 {
-	put_resources(dev, 1U << resource, owner);
+	pci230_put_resources(dev, 1U << resource, owner);
 }
 
-static void put_all_resources(struct comedi_device *dev, unsigned char owner)
+static void pci230_put_all_resources(struct comedi_device *dev,
+				     unsigned char owner)
 {
-	put_resources(dev, (1U << NUM_RESOURCES) - 1, owner);
+	pci230_put_resources(dev, (1U << NUM_RESOURCES) - 1, owner);
 }
 
-static unsigned int divide_ns(uint64_t ns, unsigned int timebase,
-			      unsigned int flags)
+static unsigned int pci230_divide_ns(uint64_t ns, unsigned int timebase,
+				     unsigned int flags)
 {
 	uint64_t div;
 	unsigned int rem;
@@ -717,7 +718,7 @@ static unsigned int pci230_choose_clk_count(uint64_t ns, unsigned int *count,
 	unsigned int clk_src, cnt;
 
 	for (clk_src = CLK_10MHZ;; clk_src++) {
-		cnt = divide_ns(ns, pci230_timebase[clk_src], flags);
+		cnt = pci230_divide_ns(ns, pci230_timebase[clk_src], flags);
 		if (cnt <= 65536 || clk_src == CLK_1KHZ)
 			break;
 	}
@@ -1112,7 +1113,7 @@ static void pci230_ao_stop(struct comedi_device *dev,
 		     devpriv->daqio + PCI230_DACCON);
 	}
 	/* Release resources. */
-	put_all_resources(dev, OWNER_AOCMD);
+	pci230_put_all_resources(dev, OWNER_AOCMD);
 }
 
 static void pci230_handle_ao_nofifo(struct comedi_device *dev,
@@ -1408,7 +1409,7 @@ static int pci230_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
 	if (cmd->scan_begin_src == TRIG_TIMER) {
 		/* Claim Z2-CT1. */
-		if (!get_one_resource(dev, RES_Z2CT1, OWNER_AOCMD))
+		if (!pci230_get_one_resource(dev, RES_Z2CT1, OWNER_AOCMD))
 			return -EBUSY;
 	}
 
@@ -1963,7 +1964,7 @@ static void pci230_ai_stop(struct comedi_device *dev,
 	outw(devpriv->adccon | PCI230_ADC_FIFO_RESET,
 	     devpriv->daqio + PCI230_ADCCON);
 	/* Release resources. */
-	put_all_resources(dev, OWNER_AICMD);
+	pci230_put_all_resources(dev, OWNER_AICMD);
 }
 
 static void pci230_ai_start(struct comedi_device *dev,
@@ -2112,7 +2113,7 @@ static void pci230_ai_start(struct comedi_device *dev,
 			}
 		} else if (cmd->convert_src != TRIG_INT) {
 			/* No longer need Z2-CT2. */
-			put_one_resource(dev, RES_Z2CT2, OWNER_AICMD);
+			pci230_put_one_resource(dev, RES_Z2CT2, OWNER_AICMD);
 		}
 	}
 }
@@ -2253,7 +2254,7 @@ static int pci230_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 		}
 	}
 	/* Claim resources. */
-	if (!get_resources(dev, res_mask, OWNER_AICMD))
+	if (!pci230_get_resources(dev, res_mask, OWNER_AICMD))
 		return -EBUSY;
 
 	/* Get number of scans required. */
-- 
2.0.4


  parent reply	other threads:[~2014-09-01 11:07 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01 11:03 [PATCH 00/28] staging: comedi: more clean-up and remove legacy attach Ian Abbott
2014-09-01 11:03 ` [PATCH 01/28] staging: comedi: amplc_pci230: update MODULE_DESCRIPTION() Ian Abbott
2014-09-01 11:03 ` [PATCH 02/28] staging: comedi: amplc_pci230: don't use multiple blank lines Ian Abbott
2014-09-01 11:03 ` [PATCH 03/28] staging: comedi: amplc_pci230: remove some unnecessary parentheses Ian Abbott
2014-09-01 11:03 ` [PATCH 04/28] staging: comedi: amplc_pci230: collapse some 'else { if' chains Ian Abbott
2014-09-01 11:03 ` [PATCH 05/28] staging: comedi: amplc_pci230: remove "legacy" attach mechanism Ian Abbott
2014-09-01 11:03 ` [PATCH 06/28] staging: comedi: amplc_pci230: no need to manipulate PCI ref count Ian Abbott
2014-09-01 11:03 ` [PATCH 07/28] staging: comedi: amplc_pci230: set detach handler to comedi_pci_detach() Ian Abbott
2014-09-01 11:03 ` [PATCH 08/28] staging: comedi: amplc_pci230: absorb pci230_attach_common() Ian Abbott
2014-09-01 11:03 ` [PATCH 09/28] staging: comedi: amplc_pci230: no need to comedi_set_hw_dev() here Ian Abbott
2014-09-01 11:03 ` [PATCH 10/28] staging: comedi: amplc_pci230: absorb pci230_alloc_private() Ian Abbott
2014-09-01 11:03 ` [PATCH 11/28] staging: comedi: amplc_pci230: remove ai_chans member Ian Abbott
2014-09-01 11:03 ` [PATCH 12/28] staging: comedi: amplc_pci230: remove ao_chans member Ian Abbott
2014-09-01 11:03 ` [PATCH 13/28] staging: comedi: amplc_pci230: shrink struct pci230_board Ian Abbott
2014-09-01 11:03 ` [PATCH 14/28] staging: comedi: amplc_pci230: simplify pci230_ao_mangle_datum() Ian Abbott
2014-09-01 11:03 ` [PATCH 15/28] staging: comedi: amplc_pci230: simplify pci230_ai_read() Ian Abbott
2014-09-01 11:03 ` [PATCH 16/28] staging: comedi: amplc_pci230: remove 'inline' Ian Abbott
2014-09-01 11:03 ` [PATCH 17/28] staging: comedi: amplc_pci230: rename pci230_ai_rinsn() Ian Abbott
2014-09-01 11:03 ` Ian Abbott [this message]
2014-09-01 11:03 ` [PATCH 19/28] staging: comedi: amplc_pci230: use comedi_range_is_bipolar() Ian Abbott
2014-09-01 11:03 ` [PATCH 20/28] staging: comedi: amplc_pci230: make `intr_running` a bitfield Ian Abbott
2014-09-01 11:03 ` [PATCH 21/28] staging: comedi: amplc_pci230: replace `state` member with bitfields Ian Abbott
2014-09-01 11:03 ` [PATCH 22/28] staging: comedi: amplc_pci230: rewrite shared resource handling Ian Abbott
2014-09-01 11:03 ` [PATCH 23/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ao_inttrig_scan_begin() Ian Abbott
2014-09-01 11:03 ` [PATCH 24/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ao_start() Ian Abbott
2014-09-01 11:03 ` [PATCH 25/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ai_inttrig_convert() Ian Abbott
2014-09-01 11:03 ` [PATCH 26/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ai_start() Ian Abbott
2014-09-01 11:03 ` [PATCH 27/28] staging: comedi: amplc_pci230: change pci230_handle_ao_fifo() return type Ian Abbott
2014-09-01 11:04 ` [PATCH 28/28] staging: comedi: amplc_pci230: simplify interrupt enable handling Ian Abbott
2014-09-02 17:43 ` [PATCH 00/28] staging: comedi: more clean-up and remove legacy attach Hartley Sweeten

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=1409569440-10979-19-git-send-email-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hartleys@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).