lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1385063878-10267-6-git-send-email-conrad.s.j.gomes@gmail.com>
Date:	Fri, 22 Nov 2013 01:27:56 +0530
From:	Conrad Gomes <conrad.s.j.gomes@...il.com>
To:	abbotti@....co.uk, hsweeten@...ionengravers.com,
	gregkh@...uxfoundation.org, joe@...ches.com
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Conrad Gomes <conrad.s.j.gomes@...il.com>
Subject: [PATCH V2 5/7] Staging: comedi: change pr_err to dev_err in __unioxx5_digital_write

This is a patch which subsitutes pr_err with the preferred dev_err
for device drivers in __unioxx5_digital_write.

The function definition of __unioxx5_digital_write has been changed
to take the pointer to the struct comedi_subdevice as a parameter
instead of the pointer to struct unioxx5_subd_priv.

The pointers to the stuct device and the struct unioxx5_subd_priv are
obtained through the pointer to the struct comedi_subdevice in this
function.

The function call to __unioxx5_digital_write in unioxx5_subdev_write
has been changed to pass the pointer to the struct comedi_subdevice

Signed-off-by: Conrad Gomes <conrad.s.j.gomes@...il.com>
---
 drivers/staging/comedi/drivers/unioxx5.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/unioxx5.c b/drivers/staging/comedi/drivers/unioxx5.c
index 7edbd5e..343ba96 100644
--- a/drivers/staging/comedi/drivers/unioxx5.c
+++ b/drivers/staging/comedi/drivers/unioxx5.c
@@ -205,15 +205,17 @@ static int __unioxx5_analog_read(struct comedi_subdevice *s,
 	return 1;
 }
 
-static int __unioxx5_digital_write(struct unioxx5_subd_priv *usp,
+static int __unioxx5_digital_write(struct comedi_subdevice *s,
 				   unsigned int *data, int channel, int minor)
 {
+	struct unioxx5_subd_priv *usp = s->private;
+	struct device *csdev = s->device->class_dev;
 	int channel_offset, val;
 	int mask = 1 << (channel & 0x07);
 
 	channel_offset = __unioxx5_define_chan_offset(channel);
 	if (channel_offset < 0) {
-		pr_err("comedi%d: undefined channel %d. channel range is 0 .. 23\n",
+		dev_err(csdev, "comedi%d: undefined channel %d. channel range is 0 .. 23\n",
 		       minor, channel);
 		return 0;
 	}
@@ -303,7 +305,7 @@ static int unioxx5_subdev_write(struct comedi_device *dev,
 	type = usp->usp_module_type[channel / 2];
 
 	if (type == MODULE_DIGITAL) {
-		if (!__unioxx5_digital_write(usp, data, channel, dev->minor))
+		if (!__unioxx5_digital_write(subdev, data, channel, dev->minor))
 			return -1;
 	} else {
 		if (!__unioxx5_analog_write(usp, data, channel, dev->minor))
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ