aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/rsrc_mgr.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-01-01 11:40:49 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-02-22 19:16:56 -0500
commitb26b2d494b659f988b4d75eb394dfa0ddac415c9 (patch)
treed262f333e529a21017dc072e604a626b38520515 /drivers/pcmcia/rsrc_mgr.c
parent93da6202264ce1256b04db8008a43882ae62d060 (diff)
resource/PCI: align functions now return start of resource
As suggested by Linus, align functions should return the start of a resource, not void. An update of "res->start" is no longer necessary. Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pcmcia/rsrc_mgr.c')
-rw-r--r--drivers/pcmcia/rsrc_mgr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index 52db17263d8b..f92a2dac13a2 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -114,22 +114,20 @@ struct pcmcia_align_data {
114 unsigned long offset; 114 unsigned long offset;
115}; 115};
116 116
117static void pcmcia_align(void *align_data, struct resource *res, 117static resource_size_t pcmcia_align(void *align_data, struct resource *res,
118 unsigned long size, unsigned long align) 118 resource_size_t size, resource_size_t align)
119{ 119{
120 struct pcmcia_align_data *data = align_data; 120 struct pcmcia_align_data *data = align_data;
121 unsigned long start; 121 resource_size_t start;
122 122
123 start = (res->start & ~data->mask) + data->offset; 123 start = (res->start & ~data->mask) + data->offset;
124 if (start < res->start) 124 if (start < res->start)
125 start += data->mask + 1; 125 start += data->mask + 1;
126 res->start = start;
127 126
128#ifdef CONFIG_X86 127#ifdef CONFIG_X86
129 if (res->flags & IORESOURCE_IO) { 128 if (res->flags & IORESOURCE_IO) {
130 if (start & 0x300) { 129 if (start & 0x300) {
131 start = (start + 0x3ff) & ~0x3ff; 130 start = (start + 0x3ff) & ~0x3ff;
132 res->start = start;
133 } 131 }
134 } 132 }
135#endif 133#endif
@@ -137,9 +135,11 @@ static void pcmcia_align(void *align_data, struct resource *res,
137#ifdef CONFIG_M68K 135#ifdef CONFIG_M68K
138 if (res->flags & IORESOURCE_IO) { 136 if (res->flags & IORESOURCE_IO) {
139 if ((res->start + size - 1) >= 1024) 137 if ((res->start + size - 1) >= 1024)
140 res->start = res->end; 138 start = res->end;
141 } 139 }
142#endif 140#endif
141
142 return start;
143} 143}
144 144
145 145