Shaun Ruffell
4bfdd8bea5
dahdi: Remove "ddev" symlink before unregistering the span device.
This makes the order of operations for device removal symmetrical with those for
device addition. This change also eliminates the following warning when
unloading dahdi after dynamic spans have been created:
------------[ cut here ]------------
WARNING: at /build/buildd/linux-3.2.0/fs/sysfs/inode.c:324 sysfs_hash_and_remove+0x92/0xa0()
Hardware name: VirtualBox
sysfs: can not remove 'ddev', no directory
Modules linked in: dahdi_dynamic_loc(O-) dahdi_dynamic(O) dahdi(O) crc_ccitt
hdlc_cisco hdlc vboxvideo(O) drm vboxsf(O) vesafb ppdev psmouse parport_pc
serio_raw mac_hid vboxguest(O) nfsd nfs i2c_piix4 lockd fscache auth_rpcgss
nfs_acl sunrpc ext2 lp parport e1000 [last unloaded: dahdi]
Pid: 3533, comm: rmmod Tainted: G W O 3.2.0-56-generic-pae #86-Ubuntu
Call Trace:
[<c105ab42>] warn_slowpath_common+0x72/0xa0
[<c11a7992>] ? sysfs_hash_and_remove+0x92/0xa0
[<c11a7992>] ? sysfs_hash_and_remove+0x92/0xa0
[<c105ac13>] warn_slowpath_fmt+0x33/0x40
[<c11a7992>] sysfs_hash_and_remove+0x92/0xa0
[<c1385427>] ? device_del+0x127/0x150
[<c11a9bd0>] sysfs_remove_link+0x20/0x30
[<d8a03fa3>] span_sysfs_remove+0xa3/0x170 [dahdi]
[<c1036a88>] ? default_spin_lock_flags+0x8/0x10
[<d89f7e5e>] _dahdi_unassign_span+0xae/0x210 [dahdi]
[<c1053f6b>] ? __cond_resched+0x1b/0x30
[<c15a9859>] ? _cond_resched+0x29/0x30
[<d89f80a3>] dahdi_unregister_device+0xe3/0x190 [dahdi]
[<d8936464>] dahdi_dynamic_unregister_driver+0x84/0x130 [dahdi_dynamic]
[<d89284ed>] dahdi_dynamic_local_exit+0xd/0xb20 [dahdi_dynamic_loc]
[<c1095995>] sys_delete_module+0x135/0x230
[<c1110063>] ? pagetypeinfo_show.part.8+0x33/0x100
[<c15b295f>] sysenter_do_call+0x12/0x28
---[ end trace b818e326720c8385 ]---
Signed-off-by: Shaun Ruffell <sruffell@digium.com>