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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ee6b20c71d49b8438ced798a9e561dbbd2991cf6.1282647258.git.ext-yuri.kululin@nokia.com>
Date:	Fri, 27 Aug 2010 18:33:20 +0400
From:	Yuri Ershov <ext-yuri.ershov@...ia.com>
To:	eric.piel@...mplin-utc.net, samu.p.onkalo@...ia.com,
	akpm@...ux-foundation.org, daniel@...aq.de
Cc:	ext-yuri.kululin@...ia.com, lm-sensors@...sensors.org,
	linux-kernel@...r.kernel.org, ext-yuri.ershov@...ia.com
Subject: [PATCH 1/2] lis3: Add device owner

Add device owner and change /dev/freefall file operations owner
according to the used driver

Signed-off-by: Yuri Kululin <ext-yuri.kululin@...ia.com>
---
 drivers/hwmon/lis3lv02d.c |    8 ++++++--
 drivers/hwmon/lis3lv02d.h |    2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c
index e278f0e..0f1bd36 100644
--- a/drivers/hwmon/lis3lv02d.c
+++ b/drivers/hwmon/lis3lv02d.c
@@ -591,8 +591,7 @@ static int lis3lv02d_misc_fasync(int fd, struct file *file, int on)
 	return fasync_helper(fd, file, on, &lis3_dev.async_queue);
 }
 
-static const struct file_operations lis3lv02d_misc_fops = {
-	.owner   = THIS_MODULE,
+static struct file_operations lis3lv02d_misc_fops = {
 	.llseek  = no_llseek,
 	.read    = lis3lv02d_misc_read,
 	.open    = lis3lv02d_misc_open,
@@ -1007,6 +1006,11 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
 		goto out;
 	}
 
+	if (dev->owner)
+		lis3lv02d_misc_fops.owner = dev->owner;
+	else
+		lis3lv02d_misc_fops.owner = THIS_MODULE;
+
 	if (misc_register(&lis3lv02d_misc_device))
 		printk(KERN_ERR DRIVER_NAME ": misc_register failed\n");
 out:
diff --git a/drivers/hwmon/lis3lv02d.h b/drivers/hwmon/lis3lv02d.h
index 1f0a66f..e63dd3d 100644
--- a/drivers/hwmon/lis3lv02d.h
+++ b/drivers/hwmon/lis3lv02d.h
@@ -258,6 +258,8 @@ struct lis3lv02d {
 	unsigned char		irq_cfg;
 	struct lis3lv02d_platform_data *pdata;	/* for passing board config */
 	struct mutex		mutex;     /* Serialize poll and selftest */
+
+	struct module		*owner;    /* Device owner */
 };
 
 int lis3lv02d_init_device(struct lis3lv02d *lis3);
-- 
1.7.1.1

--
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