diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-22 13:42:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-22 13:42:54 -0400 |
commit | 4e93d3e8859c834ee18dfd33051d24df8669d0c0 (patch) | |
tree | 13f5b39730857257b5040471618e9bcce30ed9cc /drivers/i2c/busses/i2c-mpc.c | |
parent | a0cd30fd26a398c0c6e50c6760610d4529f17a84 (diff) | |
parent | 0087e5ef577d0d6e664be7ab4be513b6a482e7ec (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Diffstat (limited to 'drivers/i2c/busses/i2c-mpc.c')
-rw-r--r-- | drivers/i2c/busses/i2c-mpc.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 6f33496d31c3..d41ca31dbcb2 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -325,7 +325,7 @@ static int __devinit mpc_i2c_probe(struct ocp_device *ocp) | |||
325 | if (i2c->irq != OCP_IRQ_NA) | 325 | if (i2c->irq != OCP_IRQ_NA) |
326 | { | 326 | { |
327 | if ((result = request_irq(ocp->def->irq, mpc_i2c_isr, | 327 | if ((result = request_irq(ocp->def->irq, mpc_i2c_isr, |
328 | 0, "i2c-mpc", i2c)) < 0) { | 328 | SA_SHIRQ, "i2c-mpc", i2c)) < 0) { |
329 | printk(KERN_ERR | 329 | printk(KERN_ERR |
330 | "i2c-mpc - failed to attach interrupt\n"); | 330 | "i2c-mpc - failed to attach interrupt\n"); |
331 | goto fail_irq; | 331 | goto fail_irq; |
@@ -333,6 +333,9 @@ static int __devinit mpc_i2c_probe(struct ocp_device *ocp) | |||
333 | } else | 333 | } else |
334 | i2c->irq = 0; | 334 | i2c->irq = 0; |
335 | 335 | ||
336 | mpc_i2c_setclock(i2c); | ||
337 | ocp_set_drvdata(ocp, i2c); | ||
338 | |||
336 | i2c->adap = mpc_ops; | 339 | i2c->adap = mpc_ops; |
337 | i2c_set_adapdata(&i2c->adap, i2c); | 340 | i2c_set_adapdata(&i2c->adap, i2c); |
338 | 341 | ||
@@ -341,8 +344,6 @@ static int __devinit mpc_i2c_probe(struct ocp_device *ocp) | |||
341 | goto fail_add; | 344 | goto fail_add; |
342 | } | 345 | } |
343 | 346 | ||
344 | mpc_i2c_setclock(i2c); | ||
345 | ocp_set_drvdata(ocp, i2c); | ||
346 | return result; | 347 | return result; |
347 | 348 | ||
348 | fail_add: | 349 | fail_add: |
@@ -358,8 +359,8 @@ static int __devinit mpc_i2c_probe(struct ocp_device *ocp) | |||
358 | static void __devexit mpc_i2c_remove(struct ocp_device *ocp) | 359 | static void __devexit mpc_i2c_remove(struct ocp_device *ocp) |
359 | { | 360 | { |
360 | struct mpc_i2c *i2c = ocp_get_drvdata(ocp); | 361 | struct mpc_i2c *i2c = ocp_get_drvdata(ocp); |
361 | ocp_set_drvdata(ocp, NULL); | ||
362 | i2c_del_adapter(&i2c->adap); | 362 | i2c_del_adapter(&i2c->adap); |
363 | ocp_set_drvdata(ocp, NULL); | ||
363 | 364 | ||
364 | if (ocp->def->irq != OCP_IRQ_NA) | 365 | if (ocp->def->irq != OCP_IRQ_NA) |
365 | free_irq(i2c->irq, i2c); | 366 | free_irq(i2c->irq, i2c); |
@@ -424,12 +425,15 @@ static int fsl_i2c_probe(struct device *device) | |||
424 | 425 | ||
425 | if (i2c->irq != 0) | 426 | if (i2c->irq != 0) |
426 | if ((result = request_irq(i2c->irq, mpc_i2c_isr, | 427 | if ((result = request_irq(i2c->irq, mpc_i2c_isr, |
427 | 0, "fsl-i2c", i2c)) < 0) { | 428 | SA_SHIRQ, "i2c-mpc", i2c)) < 0) { |
428 | printk(KERN_ERR | 429 | printk(KERN_ERR |
429 | "i2c-mpc - failed to attach interrupt\n"); | 430 | "i2c-mpc - failed to attach interrupt\n"); |
430 | goto fail_irq; | 431 | goto fail_irq; |
431 | } | 432 | } |
432 | 433 | ||
434 | mpc_i2c_setclock(i2c); | ||
435 | dev_set_drvdata(device, i2c); | ||
436 | |||
433 | i2c->adap = mpc_ops; | 437 | i2c->adap = mpc_ops; |
434 | i2c_set_adapdata(&i2c->adap, i2c); | 438 | i2c_set_adapdata(&i2c->adap, i2c); |
435 | i2c->adap.dev.parent = &pdev->dev; | 439 | i2c->adap.dev.parent = &pdev->dev; |
@@ -438,8 +442,6 @@ static int fsl_i2c_probe(struct device *device) | |||
438 | goto fail_add; | 442 | goto fail_add; |
439 | } | 443 | } |
440 | 444 | ||
441 | mpc_i2c_setclock(i2c); | ||
442 | dev_set_drvdata(device, i2c); | ||
443 | return result; | 445 | return result; |
444 | 446 | ||
445 | fail_add: | 447 | fail_add: |
@@ -456,8 +458,8 @@ static int fsl_i2c_remove(struct device *device) | |||
456 | { | 458 | { |
457 | struct mpc_i2c *i2c = dev_get_drvdata(device); | 459 | struct mpc_i2c *i2c = dev_get_drvdata(device); |
458 | 460 | ||
459 | dev_set_drvdata(device, NULL); | ||
460 | i2c_del_adapter(&i2c->adap); | 461 | i2c_del_adapter(&i2c->adap); |
462 | dev_set_drvdata(device, NULL); | ||
461 | 463 | ||
462 | if (i2c->irq != 0) | 464 | if (i2c->irq != 0) |
463 | free_irq(i2c->irq, i2c); | 465 | free_irq(i2c->irq, i2c); |