From: Ian Abbott Date: Thu, 4 Apr 2013 13:59:09 +0000 (+0100) Subject: staging: comedi: use minor device number in attribute functions X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~137^2~279 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c88db46908490f8ae3e3bca3533fbe6250762385;p=pandora-kernel.git staging: comedi: use minor device number in attribute functions The comedi device attribute functions such as `show_max_read_buffer_kb()` call `dev_get_drvdata()` to get a pointer to a `struct comedi_file_info` from the private driver data field of class device. Change them to use the minor device number to look up this pointer value so they behave more like the file operation functions. Check the pointer is non-NULL as the entry in the minor device table could have been set to NULL. Note that there is still a race condition in the use of this pointer value after acquiring the mutex which needs to be dealt with once reference counting has been implemented for comedi devices. The calls to `dev_set_drvdata()` from `comedi_alloc_board_minor()` and `comedi_alloc_subdevice_minor()` are no longer needed so remove them. Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed