diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-07-28 17:09:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 12:14:15 -0400 |
commit | cdcb19219714c796ddef1202e952566c5f86354d (patch) | |
tree | 35569bf55128dbbeac19fc05db8ce2bb940fdb18 /include | |
parent | e6cfb3ad7209e4f4dcdc14f5fc437db55667041f (diff) |
[PATCH] I2C: inline i2c_adapter_id
We could inline i2c_adapter_id, as it is really, really short. Doing
so saves a few bytes both in i2c-core and in the drivers using this
function.
before after diff
drivers/hwmon/adm1026.ko 41344 41305 -39
drivers/hwmon/asb100.ko 27325 27246 -79
drivers/hwmon/gl518sm.ko 20824 20785 -39
drivers/hwmon/it87.ko 26419 26380 -39
drivers/hwmon/lm78.ko 21424 21385 -39
drivers/hwmon/lm85.ko 41034 40939 -95
drivers/hwmon/w83781d.ko 39561 39514 -47
drivers/hwmon/w83792d.ko 32979 32932 -47
drivers/i2c/i2c-core.ko 24708 24531 -177
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index da4faa016b17..ad1c0fb164bc 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -364,10 +364,6 @@ extern int i2c_probe(struct i2c_adapter *adapter, | |||
364 | */ | 364 | */ |
365 | extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); | 365 | extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); |
366 | 366 | ||
367 | /* This call returns a unique low identifier for each registered adapter, | ||
368 | * or -1 if the adapter was not registered. | ||
369 | */ | ||
370 | extern int i2c_adapter_id(struct i2c_adapter *adap); | ||
371 | extern struct i2c_adapter* i2c_get_adapter(int id); | 367 | extern struct i2c_adapter* i2c_get_adapter(int id); |
372 | extern void i2c_put_adapter(struct i2c_adapter *adap); | 368 | extern void i2c_put_adapter(struct i2c_adapter *adap); |
373 | 369 | ||
@@ -384,6 +380,12 @@ static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func) | |||
384 | return (func & i2c_get_functionality(adap)) == func; | 380 | return (func & i2c_get_functionality(adap)) == func; |
385 | } | 381 | } |
386 | 382 | ||
383 | /* Return id number for a specific adapter */ | ||
384 | static inline int i2c_adapter_id(struct i2c_adapter *adap) | ||
385 | { | ||
386 | return adap->nr; | ||
387 | } | ||
388 | |||
387 | /* | 389 | /* |
388 | * I2C Message - used for pure i2c transaction, also from /dev interface | 390 | * I2C Message - used for pure i2c transaction, also from /dev interface |
389 | */ | 391 | */ |