From f65cc5447eaea9f7be1ff54e27c9658a66c5910f Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 1 Feb 2013 10:20:30 +0000 Subject: [PATCH] staging: comedi: change comedi_alloc_subdevice_minor parameters `comedi_alloc_subdevice_minor()` doesn't really need a parameter pointing to a `struct comedi_device` as it can get this information from the parameter pointing to a `struct comedi_subdevice`. Just pass the subdevice parameter. Signed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedi_fops.c | 4 ++-- drivers/staging/comedi/comedi_internal.h | 3 +-- drivers/staging/comedi/drivers.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index c7377d012a6d..ee127b368d57 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2352,9 +2352,9 @@ int comedi_find_board_minor(struct device *hardware_device) return -ENODEV; } -int comedi_alloc_subdevice_minor(struct comedi_device *dev, - struct comedi_subdevice *s) +int comedi_alloc_subdevice_minor(struct comedi_subdevice *s) { + struct comedi_device *dev = s->device; struct comedi_file_info *info; struct device *csdev; unsigned i; diff --git a/drivers/staging/comedi/comedi_internal.h b/drivers/staging/comedi/comedi_internal.h index f4f0ff293797..df4c67652933 100644 --- a/drivers/staging/comedi/comedi_internal.h +++ b/drivers/staging/comedi/comedi_internal.h @@ -11,8 +11,7 @@ int do_rangeinfo_ioctl(struct comedi_device *dev, int comedi_alloc_board_minor(struct device *hardware_device); void comedi_free_board_minor(unsigned minor); int comedi_find_board_minor(struct device *hardware_device); -int comedi_alloc_subdevice_minor(struct comedi_device *dev, - struct comedi_subdevice *s); +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, diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index fe91e758184f..cc6240aa5790 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -209,7 +209,7 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev, return ret; } - comedi_alloc_subdevice_minor(dev, s); + comedi_alloc_subdevice_minor(s); return 0; } -- 2.20.1