public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@Stimpy.netroedge.com
Cc: bunk@stusta.de
Subject: [PATCH] i2c-core.c: make some code static
Date: Fri, 4 Mar 2005 12:36:35 -0800	[thread overview]
Message-ID: <11099685953642@kroah.com> (raw)
In-Reply-To: <11099685952869@kroah.com>

ChangeSet 1.2096, 2005/03/02 12:12:54-08:00, bunk@stusta.de

[PATCH] i2c-core.c: make some code static

This patch makes some needlessly global code static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/i2c/i2c-core.c |   79 ++++++++++++++++++++++++-------------------------
 include/linux/i2c.h    |    2 -
 2 files changed, 39 insertions(+), 42 deletions(-)


diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c	2005-03-04 12:24:57 -08:00
+++ b/drivers/i2c/i2c-core.c	2005-03-04 12:24:57 -08:00
@@ -38,12 +38,43 @@
 static DECLARE_MUTEX(core_lists);
 static DEFINE_IDR(i2c_adapter_idr);
 
-int i2c_device_probe(struct device *dev)
+/* match always succeeds, as we want the probe() to tell if we really accept this match */
+static int i2c_device_match(struct device *dev, struct device_driver *drv)
+{
+	return 1;
+}
+
+static int i2c_bus_suspend(struct device * dev, pm_message_t state)
+{
+	int rc = 0;
+
+	if (dev->driver && dev->driver->suspend)
+		rc = dev->driver->suspend(dev,state,0);
+	return rc;
+}
+
+static int i2c_bus_resume(struct device * dev)
+{
+	int rc = 0;
+	
+	if (dev->driver && dev->driver->resume)
+		rc = dev->driver->resume(dev,0);
+	return rc;
+}
+
+static struct bus_type i2c_bus_type = {
+	.name =		"i2c",
+	.match =	i2c_device_match,
+	.suspend =      i2c_bus_suspend,
+	.resume =       i2c_bus_resume,
+};
+
+static int i2c_device_probe(struct device *dev)
 {
 	return -ENODEV;
 }
 
-int i2c_device_remove(struct device *dev)
+static int i2c_device_remove(struct device *dev)
 {
 	return 0;
 }
@@ -523,38 +554,6 @@
        up(&adap->clist_lock);
 }
 
-
-/* match always succeeds, as we want the probe() to tell if we really accept this match */
-static int i2c_device_match(struct device *dev, struct device_driver *drv)
-{
-	return 1;
-}
-
-static int i2c_bus_suspend(struct device * dev, u32 state)
-{
-	int rc = 0;
-
-	if (dev->driver && dev->driver->suspend)
-		rc = dev->driver->suspend(dev,state,0);
-	return rc;
-}
-
-static int i2c_bus_resume(struct device * dev)
-{
-	int rc = 0;
-	
-	if (dev->driver && dev->driver->resume)
-		rc = dev->driver->resume(dev,0);
-	return rc;
-}
-
-struct bus_type i2c_bus_type = {
-	.name =		"i2c",
-	.match =	i2c_device_match,
-	.suspend =      i2c_bus_suspend,
-	.resume =       i2c_bus_resume,
-};
-
 static int __init i2c_init(void)
 {
 	int retval;
@@ -860,7 +859,7 @@
 /* CRC over count bytes in the first array plus the bytes in the rest
    array if it is non-null. rest[0] is the (length of rest) - 1
    and is included. */
-u8 i2c_smbus_partial_pec(u8 crc, int count, u8 *first, u8 *rest)
+static u8 i2c_smbus_partial_pec(u8 crc, int count, u8 *first, u8 *rest)
 {
 	int i;
 
@@ -872,7 +871,7 @@
 	return crc;
 }
 
-u8 i2c_smbus_pec(int count, u8 *first, u8 *rest)
+static u8 i2c_smbus_pec(int count, u8 *first, u8 *rest)
 {
 	return i2c_smbus_partial_pec(0, count, first, rest);
 }
@@ -880,8 +879,8 @@
 /* Returns new "size" (transaction type)
    Note that we convert byte to byte_data and byte_data to word_data
    rather than invent new xxx_PEC transactions. */
-int i2c_smbus_add_pec(u16 addr, u8 command, int size,
-                      union i2c_smbus_data *data)
+static int i2c_smbus_add_pec(u16 addr, u8 command, int size,
+			     union i2c_smbus_data *data)
 {
 	u8 buf[3];
 
@@ -910,8 +909,8 @@
 	return size;	
 }
 
-int i2c_smbus_check_pec(u16 addr, u8 command, int size, u8 partial,
-                        union i2c_smbus_data *data)
+static int i2c_smbus_check_pec(u16 addr, u8 command, int size, u8 partial,
+			       union i2c_smbus_data *data)
 {
 	u8 buf[3], rpec, cpec;
 
diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h	2005-03-04 12:24:57 -08:00
+++ b/include/linux/i2c.h	2005-03-04 12:24:57 -08:00
@@ -134,8 +134,6 @@
 };
 #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
 
-extern struct bus_type i2c_bus_type;
-
 #define I2C_NAME_SIZE	50
 
 /*


  reply	other threads:[~2005-03-04 21:23 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-04 20:35 [BK PATCH] I2C patches for 2.6.11 Greg KH
2005-03-04 20:36 ` [PATCH] I2C: add fscpos chip driver Greg KH
2005-03-04 20:36   ` [PATCH] I2C: Allow it87 pwm reconfiguration Greg KH
2005-03-04 20:36     ` [PATCH] I2C: Fix up some build warnings in the fscpos driver Greg KH
2005-03-04 20:36       ` [PATCH] I2C: Kill i2c_client.id (1/5) Greg KH
2005-03-04 20:36         ` [PATCH] I2C: Kill i2c_client.id (2/5) Greg KH
2005-03-04 20:36           ` [PATCH] I2C: Kill i2c_client.id (3/5) Greg KH
2005-03-04 20:36             ` [PATCH] I2C: Kill i2c_client.id (4/5) Greg KH
2005-03-04 20:36               ` [PATCH] I2C: Kill i2c_client.id (5/5) Greg KH
2005-03-04 20:36                 ` [PATCH] I2C: just delete the id field, let's not delay it any longer Greg KH
2005-03-04 20:36                   ` [PATCH] I2C: fix for fscpos voltage values Greg KH
2005-03-04 20:36                     ` [PATCH] I2C: i2c-dev namespace cleanup Greg KH
2005-03-04 20:36                       ` [PATCH] I2C: lm78 driver improvement Greg KH
2005-03-04 20:36                         ` [PATCH] I2C: Enable w83781d and w83627hf temperature channels Greg KH
2005-03-04 20:36                           ` [PATCH] I2C: Kill unused includes in i2c-sensor-detect.c Greg KH
2005-03-04 20:36                             ` [PATCH] I2C: unnecessary #includes in asb100.c Greg KH
2005-03-04 20:36                               ` [PATCH] I2C: lm80 driver improvement Greg KH
2005-03-04 20:36                                 ` Greg KH [this message]
2005-03-04 20:36                                   ` [PATCH] I2C: use time_after instead of comparing jiffies Greg KH
2005-03-04 20:36                                     ` [PATCH] I2C: add ST M41T00 I2C RTC chip driver Greg KH
2005-03-04 20:36                                       ` [PATCH] I2C: New chip driver: sis5595 Greg KH
2005-03-04 20:36                                         ` [PATCH] I2C: add Marvell mv64xxx i2c driver Greg KH
2005-03-04 20:36                                           ` [PATCH] I2C: add GL520SM Sensor Chip driver Greg KH
2005-03-04 20:36                                             ` [PATCH] I2C: improve debugging output Greg KH
2005-03-04 20:36                                               ` [PATCH] I2C: Enable I2C_PIIX4 for 64-bit platforms Greg KH
2005-03-04 20:36                                                 ` [PATCH] I2C: fix typo in drivers/i2c/busses/i2c-ixp4xx.c Greg KH
2005-03-04 20:36                                                   ` [PATCH] I2C i2c-nforce2: add support for nForce4 (patch against 2.6.11-rc4) Greg KH
2005-03-04 20:36                                                     ` [PATCH] I2C: Remove NULL client checks in rtc8564 driver Greg KH
2005-03-04 20:36                                                       ` [PATCH] I2C: Make i2c list terminators explicitely unsigned Greg KH
2005-03-04 20:36                                                         ` [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings Greg KH
2005-03-04 20:36                                                           ` [PATCH] I2C: S3C2410 missing I2C_CLASS_HWMON Greg KH
2005-03-04 20:36                                                             ` [PATCH] I2C: minor I2C cleanups Greg KH
2005-03-04 20:36                                                               ` [PATCH] Add class definition to the elektor bus driver Greg KH
2005-03-04 20:36                                                                 ` [PATCH] I2C: saa7146 build fix Greg KH
2005-03-04 20:36                                                                   ` [PATCH] I2C: w83627hf needs i2c-isa Greg KH
2005-03-04 20:36                                                                     ` [PATCH] I2C: fixed up the i2c-id.h algo ids Greg KH
2005-03-04 20:36                                                                       ` [PATCH] I2C: Change of i2c co-maintainer Greg KH
2005-03-04 20:36                                                                         ` [PATCH] I2C: Trivial indentation fix in i2c/chips/Kconfig Greg KH
2005-03-04 22:55                                                           ` [PATCH] I2C: Fix some gcc 4.0 compile failures and warnings Mickey Stein
2005-03-04 23:02                                                             ` Greg KH
2005-03-05  5:57                                 ` [RFQ] Rules for accepting patches into the linux-releases tree Shawn Starr
2005-03-05  6:11                                   ` Randy.Dunlap
2005-03-05 16:33                                   ` Greg KH
2005-03-24  6:39                                 ` [2.6.11.5][BUILD] i2c.h breakage in 2.6.12-rc1 + -mm only Shawn Starr
2005-03-24  8:03                                   ` Greg KH
2005-03-05 11:59 ` [BK PATCH] I2C patches for 2.6.11 Jean Delvare
2005-03-06  6:55   ` Greg KH
2005-03-07  8:50     ` Adrian Bunk
2005-03-08  8:41     ` Domen Puncer

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=11099685953642@kroah.com \
    --to=greg@kroah.com \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@Stimpy.netroedge.com \
    /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