projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux
[deliverable/linux.git]
/
drivers
/
video
/
pxa3xx-gcu.c
diff --git
a/drivers/video/pxa3xx-gcu.c
b/drivers/video/pxa3xx-gcu.c
index 6c984eacc7e350bf87a8a6078cb7f4fadc845d8c..97563c55af63e46d8a6a00cf6f036b3df6e8e203 100644
(file)
--- a/
drivers/video/pxa3xx-gcu.c
+++ b/
drivers/video/pxa3xx-gcu.c
@@
-101,7
+101,6
@@
struct pxa3xx_gcu_priv {
dma_addr_t shared_phys;
struct resource *resource_mem;
struct miscdevice misc_dev;
dma_addr_t shared_phys;
struct resource *resource_mem;
struct miscdevice misc_dev;
- struct file_operations misc_fops;
wait_queue_head_t wait_idle;
wait_queue_head_t wait_free;
spinlock_t spinlock;
wait_queue_head_t wait_idle;
wait_queue_head_t wait_free;
spinlock_t spinlock;
@@
-369,15
+368,20
@@
pxa3xx_gcu_wait_free(struct pxa3xx_gcu_priv *priv)
/* Misc device layer */
/* Misc device layer */
+static inline struct pxa3xx_gcu_priv *file_dev(struct file *file)
+{
+ struct miscdevice *dev = file->private_data;
+ return container_of(dev, struct pxa3xx_gcu_priv, misc_dev);
+}
+
static ssize_t
static ssize_t
-pxa3xx_gcu_misc_write(struct file *fil
p
, const char *buff,
+pxa3xx_gcu_misc_write(struct file *fil
e
, const char *buff,
size_t count, loff_t *offp)
{
int ret;
unsigned long flags;
struct pxa3xx_gcu_batch *buffer;
size_t count, loff_t *offp)
{
int ret;
unsigned long flags;
struct pxa3xx_gcu_batch *buffer;
- struct pxa3xx_gcu_priv *priv =
- container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops);
+ struct pxa3xx_gcu_priv *priv = file_dev(file);
int words = count / 4;
int words = count / 4;
@@
-450,11
+454,10
@@
pxa3xx_gcu_misc_write(struct file *filp, const char *buff,
static long
static long
-pxa3xx_gcu_misc_ioctl(struct file *fil
p
, unsigned int cmd, unsigned long arg)
+pxa3xx_gcu_misc_ioctl(struct file *fil
e
, unsigned int cmd, unsigned long arg)
{
unsigned long flags;
{
unsigned long flags;
- struct pxa3xx_gcu_priv *priv =
- container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops);
+ struct pxa3xx_gcu_priv *priv = file_dev(file);
switch (cmd) {
case PXA3XX_GCU_IOCTL_RESET:
switch (cmd) {
case PXA3XX_GCU_IOCTL_RESET:
@@
-471,11
+474,10
@@
pxa3xx_gcu_misc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
}
static int
}
static int
-pxa3xx_gcu_misc_mmap(struct file *fil
p
, struct vm_area_struct *vma)
+pxa3xx_gcu_misc_mmap(struct file *fil
e
, struct vm_area_struct *vma)
{
unsigned int size = vma->vm_end - vma->vm_start;
{
unsigned int size = vma->vm_end - vma->vm_start;
- struct pxa3xx_gcu_priv *priv =
- container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops);
+ struct pxa3xx_gcu_priv *priv = file_dev(file);
switch (vma->vm_pgoff) {
case 0:
switch (vma->vm_pgoff) {
case 0:
@@
-574,6
+576,13
@@
free_buffers(struct platform_device *dev,
priv->free = NULL;
}
priv->free = NULL;
}
+static const struct file_operations misc_fops = {
+ .owner = THIS_MODULE,
+ .write = pxa3xx_gcu_misc_write,
+ .unlocked_ioctl = pxa3xx_gcu_misc_ioctl,
+ .mmap = pxa3xx_gcu_misc_mmap
+};
+
static int pxa3xx_gcu_probe(struct platform_device *dev)
{
int i, ret, irq;
static int pxa3xx_gcu_probe(struct platform_device *dev)
{
int i, ret, irq;
@@
-601,14
+610,9
@@
static int pxa3xx_gcu_probe(struct platform_device *dev)
* container_of(). This isn't really necessary as we have a fixed minor
* number anyway, but this is to avoid statics. */
* container_of(). This isn't really necessary as we have a fixed minor
* number anyway, but this is to avoid statics. */
- priv->misc_fops.owner = THIS_MODULE;
- priv->misc_fops.write = pxa3xx_gcu_misc_write;
- priv->misc_fops.unlocked_ioctl = pxa3xx_gcu_misc_ioctl;
- priv->misc_fops.mmap = pxa3xx_gcu_misc_mmap;
-
priv->misc_dev.minor = MISCDEV_MINOR,
priv->misc_dev.name = DRV_NAME,
priv->misc_dev.minor = MISCDEV_MINOR,
priv->misc_dev.name = DRV_NAME,
- priv->misc_dev.fops = &
priv->
misc_fops,
+ priv->misc_dev.fops = &misc_fops,
/* register misc device */
ret = misc_register(&priv->misc_dev);
/* register misc device */
ret = misc_register(&priv->misc_dev);
This page took
0.026429 seconds
and
5
git commands to generate.