From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
To: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Cc: Martyn Welch <martyn.welch@ge.com>,
Manohar Vanga <manohar.vanga@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Igor Alekseev <igor.alekseev@itep.ru>,
Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Subject: [PATCHv2 13/16] staging: vme_user: remove open/release
Date: Thu, 28 May 2015 12:31:19 +0300 [thread overview]
Message-ID: <1432805482-24129-14-git-send-email-dmitry.kalinkin@gmail.com> (raw)
In-Reply-To: <1432805482-24129-1-git-send-email-dmitry.kalinkin@gmail.com>
Checking for image[minor].resource != NULL is not needed since all
resources are allocated before device is created.
image[minor].users accounting is deleted because it's not being used.
Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Cc: Igor Alekseev <igor.alekseev@itep.ru>
---
drivers/staging/vme/devices/vme_user.c | 44 ----------------------------------
1 file changed, 44 deletions(-)
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 2493847..ce4aacf 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -102,7 +102,6 @@ struct image_desc {
struct mutex mutex; /* Mutex for locking image */
struct device *device; /* Sysfs device */
struct vme_resource *resource; /* VME resource */
- int users; /* Number of current users */
int mmap_count; /* Number of current mmap's */
};
static struct image_desc image[VME_DEVS];
@@ -125,46 +124,6 @@ struct vme_user_vma_priv {
};
-static int vme_user_open(struct inode *inode, struct file *file)
-{
- int err;
- unsigned int minor = MINOR(inode->i_rdev);
-
- mutex_lock(&image[minor].mutex);
- /* Allow device to be opened if a resource is needed and allocated. */
- if (minor < CONTROL_MINOR && image[minor].resource == NULL) {
- pr_err("No resources allocated for device\n");
- err = -EINVAL;
- goto err_res;
- }
-
- /* Increment user count */
- image[minor].users++;
-
- mutex_unlock(&image[minor].mutex);
-
- return 0;
-
-err_res:
- mutex_unlock(&image[minor].mutex);
-
- return err;
-}
-
-static int vme_user_release(struct inode *inode, struct file *file)
-{
- unsigned int minor = MINOR(inode->i_rdev);
-
- mutex_lock(&image[minor].mutex);
-
- /* Decrement user count */
- image[minor].users--;
-
- mutex_unlock(&image[minor].mutex);
-
- return 0;
-}
-
/*
* We are going ot alloc a page during init per window for small transfers.
* Small transfers will go VME -> buffer -> user space. Larger (more than a
@@ -775,8 +734,6 @@ static int vme_user_mmap(struct file *file, struct vm_area_struct *vma)
}
static const struct file_operations vme_user_fops = {
- .open = vme_user_open,
- .release = vme_user_release,
.read = vme_user_read,
.write = vme_user_write,
.llseek = vme_user_llseek,
@@ -849,7 +806,6 @@ static int vme_user_probe(struct vme_dev *vdev)
mutex_init(&image[i].mutex);
image[i].device = NULL;
image[i].resource = NULL;
- image[i].users = 0;
}
/* Assign major and minor numbers for the driver */
--
1.8.3.1
next prev parent reply other threads:[~2015-05-28 9:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 9:31 [PATCHv2 00/16] vme DMA and user space driver improvements Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 01/16] Documentation: mention vme_master_mmap() in VME API Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 02/16] vme: tsi148: fix DMA lists longer that one item Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 03/16] vme: tsi148: fix first DMA item mapping Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 04/16] vme: stop DMA transfer on interruption Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 05/16] staging: vme_user: refactor llseek to switch(){} Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 06/16] vme: check for A64 overflow in vme_check_window() Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 07/16] vme: export vme_check_window() Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 08/16] staging: vme_user: provide DMA functionality Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 09/16] vme: ca91cx42: return error code on DMA error Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 10/16] vme: ca91cx42: fix LM_CTL address mask Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 11/16] staging: vme_user: remove unused counters Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 12/16] staging: vme_user: remove forward declarations Dmitry Kalinkin
2015-05-28 9:31 ` Dmitry Kalinkin [this message]
2015-05-28 9:31 ` [PATCHv2 14/16] staging: vme_user: remove buf_unalloc helper Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 15/16] vme: tsi148: depend on HAS_DMA for Kconfig Dmitry Kalinkin
2015-05-28 9:31 ` [PATCHv2 16/16] vme: provide uapi header Dmitry Kalinkin
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=1432805482-24129-14-git-send-email-dmitry.kalinkin@gmail.com \
--to=dmitry.kalinkin@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=igor.alekseev@itep.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=manohar.vanga@gmail.com \
--cc=martyn.welch@ge.com \
/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®