habanalabs: change device_setup_cdev() to be more generic
authorOded Gabbay <oded.gabbay@gmail.com>
Tue, 30 Jul 2019 06:10:02 +0000 (09:10 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 5 Sep 2019 11:55:26 +0000 (14:55 +0300)
commitb968eb1a84e09f30eab9b88d30758187087b3492
tree6c621a5137ffd138321e2b114518f53c25614c2c
parenteb7caf84b029387fe5addb484a0fc5792a9058e1
habanalabs: change device_setup_cdev() to be more generic

This patch re-factors the device_setup_cdev() function to make it more
generic. It doesn't manipulate members of the driver's internal device
structure but instead works only on the arguments that are sent to it.

This is in preparation for using this function to create an additional
char device per ASIC.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/device.c