aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-12-09 01:14:38 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-12-09 01:14:38 -0500
commitbcd6acd51f3d4d1ada201e9bc5c40a31d6d80c71 (patch)
tree2f6dffd2d3e4dd67355a224de7e7a960335a92fd /arch/powerpc/platforms/powermac
parent11c34c7deaeeebcee342cbc35e1bb2a6711b2431 (diff)
parent3ff6a468b45b5dfeb0e903e56f4eb27d34b2437c (diff)
Merge commit 'origin/master' into next
Conflicts: include/linux/kvm.h
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index 414ca9849f23..345e2da56767 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -42,6 +42,7 @@
42#include <linux/interrupt.h> 42#include <linux/interrupt.h>
43#include <linux/timer.h> 43#include <linux/timer.h>
44#include <linux/mutex.h> 44#include <linux/mutex.h>
45#include <linux/i2c.h>
45#include <asm/keylargo.h> 46#include <asm/keylargo.h>
46#include <asm/uninorth.h> 47#include <asm/uninorth.h>
47#include <asm/io.h> 48#include <asm/io.h>
@@ -80,7 +81,7 @@ struct pmac_i2c_bus
80 struct device_node *busnode; 81 struct device_node *busnode;
81 int type; 82 int type;
82 int flags; 83 int flags;
83 struct i2c_adapter *adapter; 84 struct i2c_adapter adapter;
84 void *hostdata; 85 void *hostdata;
85 int channel; /* some hosts have multiple */ 86 int channel; /* some hosts have multiple */
86 int mode; /* current mode */ 87 int mode; /* current mode */
@@ -1014,25 +1015,9 @@ int pmac_i2c_get_channel(struct pmac_i2c_bus *bus)
1014EXPORT_SYMBOL_GPL(pmac_i2c_get_channel); 1015EXPORT_SYMBOL_GPL(pmac_i2c_get_channel);
1015 1016
1016 1017
1017void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus,
1018 struct i2c_adapter *adapter)
1019{
1020 WARN_ON(bus->adapter != NULL);
1021 bus->adapter = adapter;
1022}
1023EXPORT_SYMBOL_GPL(pmac_i2c_attach_adapter);
1024
1025void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus,
1026 struct i2c_adapter *adapter)
1027{
1028 WARN_ON(bus->adapter != adapter);
1029 bus->adapter = NULL;
1030}
1031EXPORT_SYMBOL_GPL(pmac_i2c_detach_adapter);
1032
1033struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus) 1018struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus)
1034{ 1019{
1035 return bus->adapter; 1020 return &bus->adapter;
1036} 1021}
1037EXPORT_SYMBOL_GPL(pmac_i2c_get_adapter); 1022EXPORT_SYMBOL_GPL(pmac_i2c_get_adapter);
1038 1023
@@ -1041,7 +1026,7 @@ struct pmac_i2c_bus *pmac_i2c_adapter_to_bus(struct i2c_adapter *adapter)
1041 struct pmac_i2c_bus *bus; 1026 struct pmac_i2c_bus *bus;
1042 1027
1043 list_for_each_entry(bus, &pmac_i2c_busses, link) 1028 list_for_each_entry(bus, &pmac_i2c_busses, link)
1044 if (bus->adapter == adapter) 1029 if (&bus->adapter == adapter)
1045 return bus; 1030 return bus;
1046 return NULL; 1031 return NULL;
1047} 1032}
@@ -1053,7 +1038,7 @@ int pmac_i2c_match_adapter(struct device_node *dev, struct i2c_adapter *adapter)
1053 1038
1054 if (bus == NULL) 1039 if (bus == NULL)
1055 return 0; 1040 return 0;
1056 return (bus->adapter == adapter); 1041 return (&bus->adapter == adapter);
1057} 1042}
1058EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter); 1043EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter);
1059 1044