aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:54:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:54:03 -0500
commit81ec44a6c69342fec1b1140c60a604027e429f69 (patch)
treeee6bec8a94ef28e111bf766cf4b7a9366cb4f7c1 /drivers/pci/hotplug
parent48a732dfaa77a4dfec803aa8f248373998704f76 (diff)
parente80cfc31d872b6b85b8966bce6ba80bee401a7dd (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 update from Martin Schwidefsky: "The most prominent change in this patch set is the software dirty bit patch for s390. It removes __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY and the page_test_and_clear_dirty primitive which makes the common memory management code a bit less obscure. Heiko fixed most of the PCI related fallout, more often than not missing GENERIC_HARDIRQS dependencies. Notable is one of the 3270 patches which adds an export to tty_io to be able to resize a tty. The rest is the usual bunch of cleanups and bug fixes." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (42 commits) s390/module: Add missing R_390_NONE relocation type drivers/gpio: add missing GENERIC_HARDIRQ dependency drivers/input: add couple of missing GENERIC_HARDIRQS dependencies s390/cleanup: rename SPP to LPP s390/mm: implement software dirty bits s390/mm: Fix crst upgrade of mmap with MAP_FIXED s390/linker skript: discard exit.data at runtime drivers/media: add missing GENERIC_HARDIRQS dependency s390/bpf,jit: add vlan tag support drivers/net,AT91RM9200: add missing GENERIC_HARDIRQS dependency iucv: fix kernel panic at reboot s390/Kconfig: sort list of arch selected config options phylib: remove !S390 dependeny from Kconfig uio: remove !S390 dependency from Kconfig dasd: fix sysfs cleanup in dasd_generic_remove s390/pci: fix hotplug module init s390/pci: cleanup clp page allocation s390/pci: cleanup clp inline assembly s390/perf: cpum_cf: fallback to software sampling events s390/mm: provide PAGE_SHARED define ...
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/s390_pci_hpc.c60
1 files changed, 26 insertions, 34 deletions
diff --git a/drivers/pci/hotplug/s390_pci_hpc.c b/drivers/pci/hotplug/s390_pci_hpc.c
index dee68e0698e1..7db249a25016 100644
--- a/drivers/pci/hotplug/s390_pci_hpc.c
+++ b/drivers/pci/hotplug/s390_pci_hpc.c
@@ -172,25 +172,6 @@ error:
172 return -ENOMEM; 172 return -ENOMEM;
173} 173}
174 174
175static int __init init_pci_slots(void)
176{
177 struct zpci_dev *zdev;
178 int device = 0;
179
180 /*
181 * Create a structure for each slot, and register that slot
182 * with the pci_hotplug subsystem.
183 */
184 mutex_lock(&zpci_list_lock);
185 list_for_each_entry(zdev, &zpci_list, entry) {
186 init_pci_slot(zdev);
187 device++;
188 }
189
190 mutex_unlock(&zpci_list_lock);
191 return (device) ? 0 : -ENODEV;
192}
193
194static void exit_pci_slot(struct zpci_dev *zdev) 175static void exit_pci_slot(struct zpci_dev *zdev)
195{ 176{
196 struct list_head *tmp, *n; 177 struct list_head *tmp, *n;
@@ -205,6 +186,26 @@ static void exit_pci_slot(struct zpci_dev *zdev)
205 } 186 }
206} 187}
207 188
189static struct pci_hp_callback_ops hp_ops = {
190 .create_slot = init_pci_slot,
191 .remove_slot = exit_pci_slot,
192};
193
194static void __init init_pci_slots(void)
195{
196 struct zpci_dev *zdev;
197
198 /*
199 * Create a structure for each slot, and register that slot
200 * with the pci_hotplug subsystem.
201 */
202 mutex_lock(&zpci_list_lock);
203 list_for_each_entry(zdev, &zpci_list, entry) {
204 init_pci_slot(zdev);
205 }
206 mutex_unlock(&zpci_list_lock);
207}
208
208static void __exit exit_pci_slots(void) 209static void __exit exit_pci_slots(void)
209{ 210{
210 struct list_head *tmp, *n; 211 struct list_head *tmp, *n;
@@ -224,28 +225,19 @@ static void __exit exit_pci_slots(void)
224 225
225static int __init pci_hotplug_s390_init(void) 226static int __init pci_hotplug_s390_init(void)
226{ 227{
227 /* 228 if (!s390_pci_probe)
228 * Do specific initialization stuff for your driver here
229 * like initializing your controller hardware (if any) and
230 * determining the number of slots you have in the system
231 * right now.
232 */
233
234 if (!pci_probe)
235 return -EOPNOTSUPP; 229 return -EOPNOTSUPP;
236 230
237 /* register callbacks for slot handling from arch code */ 231 zpci_register_hp_ops(&hp_ops);
238 mutex_lock(&zpci_list_lock); 232 init_pci_slots();
239 hotplug_ops.create_slot = init_pci_slot; 233
240 hotplug_ops.remove_slot = exit_pci_slot; 234 return 0;
241 mutex_unlock(&zpci_list_lock);
242 pr_info("registered hotplug slot callbacks\n");
243 return init_pci_slots();
244} 235}
245 236
246static void __exit pci_hotplug_s390_exit(void) 237static void __exit pci_hotplug_s390_exit(void)
247{ 238{
248 exit_pci_slots(); 239 exit_pci_slots();
240 zpci_deregister_hp_ops();
249} 241}
250 242
251module_init(pci_hotplug_s390_init); 243module_init(pci_hotplug_s390_init);