A parent-less device should not crash dahdi
authorOron Peled <oron.peled@xorcom.com>
Wed, 21 Mar 2012 19:12:02 +0000 (19:12 +0000)
committerShaun Ruffell <sruffell@digium.com>
Wed, 21 Mar 2012 19:12:02 +0000 (19:12 +0000)
commit52b56c984832f1851c2368c36466ea4f2d420c4d
tree97027fb5b33795362b7de903f86013fe1f28cae3
parenteff796fd8fcd467cafc0f55fd60234f51a7600b3
A parent-less device should not crash dahdi

* A parent-less device should not crash dahdi:
  - Access span->parent->dev instead of span->parent-dev.parent
    in soem cases.
  - Access span->parent->dev via new inline span_device()
  - Use span_device() in all dahdi_dev_{dbg,info}()

* Allow low-level drivers to set their device name.
  - Drivers that don't use this feature get the default name
    based on the parent device name
  - Parent-less devices which don't set their name, fails
    to register with -EINVAL

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10449

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10568 a0bf4364-ded3-4de4-8d8a-66a801d63aff
drivers/dahdi/dahdi-base.c
drivers/dahdi/dahdi-sysfs.c