summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/low_i2c.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2006-07-12 15:40:29 +1000
committerPaul Mackerras <paulus@samba.org>2006-07-31 15:55:05 +1000
commit018a3d1db7cdb6127656c1622ee1d2302e16436d (patch)
tree5b6714fa9fcd1441f7c1b30e0391484c095925b6 /arch/powerpc/platforms/powermac/low_i2c.c
parenteeb2b723ef5100fafa381d92eb70d83e98516a44 (diff)
downloadop-kernel-dev-018a3d1db7cdb6127656c1622ee1d2302e16436d.zip
op-kernel-dev-018a3d1db7cdb6127656c1622ee1d2302e16436d.tar.gz
[POWERPC] powermac: Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its return value. Also, treat the return value as const, so we can constify get_property later. powermac platform & macintosh driver changes. Built for pmac32_defconfig, g5_defconfig Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac/low_i2c.c')
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index 8677f50..c2c7cf7 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -477,7 +477,8 @@ static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
{
struct pmac_i2c_host_kw *host;
- u32 *psteps, *prate, *addrp, steps;
+ const u32 *psteps, *prate, *addrp;
+ u32 steps;
host = kzalloc(sizeof(struct pmac_i2c_host_kw), GFP_KERNEL);
if (host == NULL) {
@@ -490,7 +491,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
* on all i2c keywest nodes so far ... we would have to fallback
* to macio parsing if that wasn't the case
*/
- addrp = (u32 *)get_property(np, "AAPL,address", NULL);
+ addrp = get_property(np, "AAPL,address", NULL);
if (addrp == NULL) {
printk(KERN_ERR "low_i2c: Can't find address for %s\n",
np->full_name);
@@ -504,13 +505,13 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
host->timeout_timer.function = kw_i2c_timeout;
host->timeout_timer.data = (unsigned long)host;
- psteps = (u32 *)get_property(np, "AAPL,address-step", NULL);
+ psteps = get_property(np, "AAPL,address-step", NULL);
steps = psteps ? (*psteps) : 0x10;
for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++)
steps >>= 1;
/* Select interface rate */
host->speed = KW_I2C_MODE_25KHZ;
- prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL);
+ prate = get_property(np, "AAPL,i2c-rate", NULL);
if (prate) switch(*prate) {
case 100:
host->speed = KW_I2C_MODE_100KHZ;
@@ -618,8 +619,8 @@ static void __init kw_i2c_probe(void)
} else {
for (child = NULL;
(child = of_get_next_child(np, child)) != NULL;) {
- u32 *reg =
- (u32 *)get_property(child, "reg", NULL);
+ const u32 *reg = get_property(child,
+ "reg", NULL);
if (reg == NULL)
continue;
kw_i2c_add(host, np, child, *reg);
@@ -881,7 +882,7 @@ static void __init smu_i2c_probe(void)
{
struct device_node *controller, *busnode;
struct pmac_i2c_bus *bus;
- u32 *reg;
+ const u32 *reg;
int sz;
if (!smu_present())
@@ -904,7 +905,7 @@ static void __init smu_i2c_probe(void)
if (strcmp(busnode->type, "i2c") &&
strcmp(busnode->type, "i2c-bus"))
continue;
- reg = (u32 *)get_property(busnode, "reg", NULL);
+ reg = get_property(busnode, "reg", NULL);
if (reg == NULL)
continue;
@@ -948,9 +949,8 @@ struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node)
list_for_each_entry(bus, &pmac_i2c_busses, link) {
if (p == bus->busnode) {
if (prev && bus->flags & pmac_i2c_multibus) {
- u32 *reg;
- reg = (u32 *)get_property(prev, "reg",
- NULL);
+ const u32 *reg;
+ reg = get_property(prev, "reg", NULL);
if (!reg)
continue;
if (((*reg) >> 8) != bus->channel)
@@ -971,7 +971,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_find_bus);
u8 pmac_i2c_get_dev_addr(struct device_node *device)
{
- u32 *reg = (u32 *)get_property(device, "reg", NULL);
+ const u32 *reg = get_property(device, "reg", NULL);
if (reg == NULL)
return 0;
OpenPOWER on IntegriCloud