diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 10:51:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 10:51:49 -0400 |
commit | 1dfd166e93f98892aa4427069a23ed73259983c8 (patch) | |
tree | c70a347b963091b99bd16842537153fa36e5c0e9 /drivers/i2c | |
parent | 8e775167d54e6521e7cdbc03ee7ec42a8c67b49a (diff) | |
parent | 8df399018df120d28f89fda6f2515cc6e096e43d (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (110 commits)
sh: i2c-sh7760: Replase from ctrl_* to __raw_*
sh: clkfwk: Shuffle around to match the intc split up.
sh: clkfwk: modify for_each_frequency end condition
sh: fix clk_get() error handling
sh: clkfwk: Fix fault in frequency iterator.
sh: clkfwk: Add a helper for rate rounding by divisor ranges.
sh: clkfwk: Abstract rate rounding helper.
sh: clkfwk: support clock remapping.
sh: pci: Convert to upper/lower_32_bits() helpers.
sh: mach-sdk7786: Add support for the FPGA SRAM.
sh: Provide a generic SRAM pool for tiny memories.
sh: pci: Support secondary FPGA-driven PCIe clocks on SDK7786.
sh: pci: Support slot 4 routing on SDK7786.
sh: Fix up PMB locking.
sh: mach-sdk7786: Add support for fpga gpios.
sh: use pr_fmt for clock framework, too.
sh: remove name and id from struct clk
sh: free-without-alloc fix for sh_mobile_lcdcfb
sh: perf: Set up perf_max_events.
sh: perf: Support SH-X3 hardware counters.
...
Fix up trivial conflicts (perf_max_events got removed) in arch/sh/kernel/perf_event.c
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-sh7760.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sh_mobile.c | 23 |
2 files changed, 15 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index 4f93da31d3ad..3cad8fecc3d3 100644 --- a/drivers/i2c/busses/i2c-sh7760.c +++ b/drivers/i2c/busses/i2c-sh7760.c | |||
@@ -101,12 +101,12 @@ struct cami2c { | |||
101 | 101 | ||
102 | static inline void OUT32(struct cami2c *cam, int reg, unsigned long val) | 102 | static inline void OUT32(struct cami2c *cam, int reg, unsigned long val) |
103 | { | 103 | { |
104 | ctrl_outl(val, (unsigned long)cam->iobase + reg); | 104 | __raw_writel(val, (unsigned long)cam->iobase + reg); |
105 | } | 105 | } |
106 | 106 | ||
107 | static inline unsigned long IN32(struct cami2c *cam, int reg) | 107 | static inline unsigned long IN32(struct cami2c *cam, int reg) |
108 | { | 108 | { |
109 | return ctrl_inl((unsigned long)cam->iobase + reg); | 109 | return __raw_readl((unsigned long)cam->iobase + reg); |
110 | } | 110 | } |
111 | 111 | ||
112 | static irqreturn_t sh7760_i2c_irq(int irq, void *ptr) | 112 | static irqreturn_t sh7760_i2c_irq(int irq, void *ptr) |
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 598c49acaeb5..2707f5e17158 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c | |||
@@ -538,15 +538,17 @@ static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, int hook) | |||
538 | { | 538 | { |
539 | struct resource *res; | 539 | struct resource *res; |
540 | int ret = -ENXIO; | 540 | int ret = -ENXIO; |
541 | int q, m; | 541 | int n, k = 0; |
542 | int k = 0; | ||
543 | int n = 0; | ||
544 | 542 | ||
545 | while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) { | 543 | while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) { |
546 | for (n = res->start; hook && n <= res->end; n++) { | 544 | for (n = res->start; hook && n <= res->end; n++) { |
547 | if (request_irq(n, sh_mobile_i2c_isr, IRQF_DISABLED, | 545 | if (request_irq(n, sh_mobile_i2c_isr, IRQF_DISABLED, |
548 | dev_name(&dev->dev), dev)) | 546 | dev_name(&dev->dev), dev)) { |
547 | for (n--; n >= res->start; n--) | ||
548 | free_irq(n, dev); | ||
549 | |||
549 | goto rollback; | 550 | goto rollback; |
551 | } | ||
550 | } | 552 | } |
551 | k++; | 553 | k++; |
552 | } | 554 | } |
@@ -554,16 +556,17 @@ static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, int hook) | |||
554 | if (hook) | 556 | if (hook) |
555 | return k > 0 ? 0 : -ENOENT; | 557 | return k > 0 ? 0 : -ENOENT; |
556 | 558 | ||
557 | k--; | ||
558 | ret = 0; | 559 | ret = 0; |
559 | 560 | ||
560 | rollback: | 561 | rollback: |
561 | for (q = k; k >= 0; k--) { | 562 | k--; |
562 | for (m = n; m >= res->start; m--) | 563 | |
563 | free_irq(m, dev); | 564 | while (k >= 0) { |
565 | res = platform_get_resource(dev, IORESOURCE_IRQ, k); | ||
566 | for (n = res->start; n <= res->end; n++) | ||
567 | free_irq(n, dev); | ||
564 | 568 | ||
565 | res = platform_get_resource(dev, IORESOURCE_IRQ, k - 1); | 569 | k--; |
566 | m = res->end; | ||
567 | } | 570 | } |
568 | 571 | ||
569 | return ret; | 572 | return ret; |