Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2ad078b authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: comedi_fops: use pr_fmt()



There are a number of pr_{level} messages in this file that are used
to print kernel messages when the device pointer is not available for
a dev_{level} message.

Use pr_fmt() to ensure all of these messages have the module prefix.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2042088c
Loading
Loading
Loading
Loading
+10 −9
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@
    GNU General Public License for more details.
    GNU General Public License for more details.
*/
*/


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "comedi_compat32.h"
#include "comedi_compat32.h"


#include <linux/module.h>
#include <linux/module.h>
@@ -1073,11 +1075,10 @@ static int check_insn_config_length(struct comedi_insn *insn,
		/* by default we allow the insn since we don't have checks for
		/* by default we allow the insn since we don't have checks for
		 * all possible cases yet */
		 * all possible cases yet */
	default:
	default:
		pr_warn("comedi: No check for data length of config insn id %i is implemented.\n",
		pr_warn("No check for data length of config insn id %i is implemented\n",
			data[0]);
			data[0]);
		pr_warn("comedi: Add a check to %s in %s.\n",
		pr_warn("Add a check to %s in %s\n", __func__, __FILE__);
			__func__, __FILE__);
		pr_warn("Assuming n=%i is correct\n", insn->n);
		pr_warn("comedi: Assuming n=%i is correct.\n", insn->n);
		return 0;
		return 0;
	}
	}
	return -EINVAL;
	return -EINVAL;
@@ -2463,7 +2464,7 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device)
		mutex_unlock(&dev->mutex);
		mutex_unlock(&dev->mutex);
		comedi_device_cleanup(dev);
		comedi_device_cleanup(dev);
		comedi_dev_put(dev);
		comedi_dev_put(dev);
		pr_err("comedi: error: ran out of minor numbers for board device files.\n");
		pr_err("ran out of minor numbers for board device files\n");
		return ERR_PTR(-EBUSY);
		return ERR_PTR(-EBUSY);
	}
	}
	dev->minor = i;
	dev->minor = i;
@@ -2516,7 +2517,7 @@ int comedi_alloc_subdevice_minor(struct comedi_subdevice *s)
	}
	}
	mutex_unlock(&comedi_subdevice_minor_table_lock);
	mutex_unlock(&comedi_subdevice_minor_table_lock);
	if (i == COMEDI_NUM_SUBDEVICE_MINORS) {
	if (i == COMEDI_NUM_SUBDEVICE_MINORS) {
		pr_err("comedi: error: ran out of minor numbers for subdevice files.\n");
		pr_err("ran out of minor numbers for subdevice files\n");
		return -EBUSY;
		return -EBUSY;
	}
	}
	i += COMEDI_NUM_BOARD_MINORS;
	i += COMEDI_NUM_BOARD_MINORS;
@@ -2566,11 +2567,11 @@ static int __init comedi_init(void)
	int i;
	int i;
	int retval;
	int retval;


	pr_info("comedi: version " COMEDI_RELEASE " - http://www.comedi.org\n");
	pr_info("version " COMEDI_RELEASE " - http://www.comedi.org\n");


	if (comedi_num_legacy_minors < 0 ||
	if (comedi_num_legacy_minors < 0 ||
	    comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
	    comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
		pr_err("comedi: error: invalid value for module parameter \"comedi_num_legacy_minors\".  Valid values are 0 through %i.\n",
		pr_err("invalid value for module parameter \"comedi_num_legacy_minors\".  Valid values are 0 through %i.\n",
		       COMEDI_NUM_BOARD_MINORS);
		       COMEDI_NUM_BOARD_MINORS);
		return -EINVAL;
		return -EINVAL;
	}
	}
@@ -2596,7 +2597,7 @@ static int __init comedi_init(void)
	}
	}
	comedi_class = class_create(THIS_MODULE, "comedi");
	comedi_class = class_create(THIS_MODULE, "comedi");
	if (IS_ERR(comedi_class)) {
	if (IS_ERR(comedi_class)) {
		pr_err("comedi: failed to create class\n");
		pr_err("failed to create class\n");
		cdev_del(&comedi_cdev);
		cdev_del(&comedi_cdev);
		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
					 COMEDI_NUM_MINORS);
					 COMEDI_NUM_MINORS);