• Tejun Heo's avatar
    tidspbridge: convert to idr_alloc() · 8e467e85
    Tejun Heo authored
    idr_get_new*() and friends are about to be deprecated.  Convert to the
    new idr_alloc() interface.
    
    There are some peculiarities and possible bugs in the converted
    functions.  This patch preserves those.
    
    * drv_insert_node_res_element() returns -ENOMEM on alloc failure,
      -EFAULT if id space is exhausted.  -EFAULT is at best misleading.
    
    * drv_proc_insert_strm_res_element() is even weirder.  It returns
      -EFAULT if kzalloc() fails, -ENOMEM if idr preloading fails and
      -EPERM if id space is exhausted.  What's going on here?
    
    * drv_proc_insert_strm_res_element() doesn't free *pstrm_res after
      failure.
    
    Only compile tested.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
    Cc: Rene Sapiens <rene.sapiens@ti.com>
    Cc: Armando Uribe <x0095078@ti.com>
    Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    8e467e85
drv.c 21.1 KB