![Ian Abbott](/assets/img/avatar_default.png)
Change `comedi_alloc_board_minor()` to return a pointer to the allocated `struct comedi_device` instead of a minor device number. Return an `ERR_PTR()` value on error instead of a negative error number. This saves a call to `comedi_dev_from_minor()` in `comedi_auto_config()`. Also change it to use a local variable `dev` to hold the pointer to the `struct comedi_device` instead of using `info->device` all the time. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
#ifndef _COMEDI_INTERNAL_H
|
|
#define _COMEDI_INTERNAL_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
/*
|
|
* various internal comedi stuff
|
|
*/
|
|
int do_rangeinfo_ioctl(struct comedi_device *dev,
|
|
struct comedi_rangeinfo __user *arg);
|
|
struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device);
|
|
void comedi_release_hardware_device(struct device *hardware_device);
|
|
int comedi_alloc_subdevice_minor(struct comedi_subdevice *s);
|
|
void comedi_free_subdevice_minor(struct comedi_subdevice *s);
|
|
|
|
int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
|
|
unsigned long new_size);
|
|
void comedi_buf_reset(struct comedi_async *async);
|
|
unsigned int comedi_buf_write_n_allocated(struct comedi_async *async);
|
|
|
|
extern unsigned int comedi_default_buf_size_kb;
|
|
extern unsigned int comedi_default_buf_maxsize_kb;
|
|
|
|
/* drivers.c */
|
|
|
|
extern struct comedi_driver *comedi_drivers;
|
|
|
|
int insn_inval(struct comedi_device *, struct comedi_subdevice *,
|
|
struct comedi_insn *, unsigned int *);
|
|
|
|
void comedi_device_detach(struct comedi_device *);
|
|
int comedi_device_attach(struct comedi_device *, struct comedi_devconfig *);
|
|
|
|
#ifdef CONFIG_PROC_FS
|
|
|
|
/* proc.c */
|
|
|
|
void comedi_proc_init(void);
|
|
void comedi_proc_cleanup(void);
|
|
#else
|
|
static inline void comedi_proc_init(void)
|
|
{
|
|
}
|
|
static inline void comedi_proc_cleanup(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif /* _COMEDI_INTERNAL_H */
|