From: Benedikt Spranger <b.spranger@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: hjk@hansjkoch.de, gregkh@linuxfoundation.org,
Alexander.Frank@eberspaecher.com,
Benedikt Spranger <b.spranger@linutronix.de>
Subject: [PATCH 2/2] uio: do not expose inode to uio open/release hooks
Date: Wed, 12 Dec 2012 00:12:02 +0100 [thread overview]
Message-ID: <1355267523-19724-3-git-send-email-b.spranger@linutronix.de> (raw)
In-Reply-To: <1355267523-19724-1-git-send-email-b.spranger@linutronix.de>
The inode parameter is unused by in kernel users of UIO. Also the inode
parameter makes it hard to resolve the existing open(), mmap() and close()
difficulty.
Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
---
Documentation/DocBook/uio-howto.tmpl | 4 ++--
drivers/uio/uio.c | 4 ++--
include/linux/uio_driver.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
index 59a886d..589992e 100644
--- a/Documentation/DocBook/uio-howto.tmpl
+++ b/Documentation/DocBook/uio-howto.tmpl
@@ -490,14 +490,14 @@ instead of the built-in one.
</para></listitem>
<listitem><para>
-<varname>int (*open)(struct uio_info *info, struct inode *inode)
+<varname>int (*open)(struct uio_info *info)
</varname>: Optional. You might want to have your own
<function>open()</function>, e.g. to enable interrupts only when your
device is actually used.
</para></listitem>
<listitem><para>
-<varname>int (*release)(struct uio_info *info, struct inode *inode)
+<varname>int (*release)(struct uio_info *info)
</varname>: Optional. If you define your own
<function>release()</function>, you will probably also want a custom
<function>release()</function> function.
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 5110f36..bbffc38 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -465,7 +465,7 @@ static int uio_open(struct inode *inode, struct file *filep)
filep->private_data = listener;
if (idev->info->open) {
- ret = idev->info->open(idev->info, inode);
+ ret = idev->info->open(idev->info);
if (ret)
goto err_infoopen;
}
@@ -496,7 +496,7 @@ static int uio_release(struct inode *inode, struct file *filep)
struct uio_device *idev = listener->dev;
if (idev->info->release)
- ret = idev->info->release(idev->info, inode);
+ ret = idev->info->release(idev->info);
module_put(idev->owner);
kfree(listener);
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 1ad4724..ad59ded 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -92,8 +92,8 @@ struct uio_info {
void *priv;
irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
- int (*open)(struct uio_info *info, struct inode *inode);
- int (*release)(struct uio_info *info, struct inode *inode);
+ int (*open)(struct uio_info *info);
+ int (*release)(struct uio_info *info);
int (*irqcontrol)(struct uio_info *info, s32 irq_on);
};
--
1.7.10.4
next prev parent reply other threads:[~2012-12-11 23:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-11 23:12 [PATCH 0/2] uio: open(), mmap(), close() Benedikt Spranger
2012-12-11 23:12 ` [PATCH 1/2] uio: add warning to documentation Benedikt Spranger
2012-12-11 23:18 ` Greg KH
2012-12-12 0:45 ` Benedikt Spranger
2012-12-12 4:49 ` Greg KH
2012-12-12 1:56 ` Hans J. Koch
2012-12-12 4:47 ` Greg KH
2012-12-11 23:12 ` Benedikt Spranger [this message]
2012-12-11 23:20 ` [PATCH 2/2] uio: do not expose inode to uio open/release hooks Greg KH
2012-12-12 1:42 ` Hans J. Koch
2012-12-12 4:46 ` Greg KH
2012-12-12 8:50 ` Hans J. Koch
2012-12-12 8:56 ` Benedikt Spranger
2012-12-12 15:08 ` Greg KH
2012-12-13 0:08 ` Hans J. Koch
2012-12-13 0:15 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1355267523-19724-3-git-send-email-b.spranger@linutronix.de \
--to=b.spranger@linutronix.de \
--cc=Alexander.Frank@eberspaecher.com \
--cc=gregkh@linuxfoundation.org \
--cc=hjk@hansjkoch.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®