aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char/flash.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-08-06 13:13:54 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-08-06 13:13:54 -0400
commit11e4afb49b7fa1fc8e1ffd850c1806dd86a08204 (patch)
tree9e57efcb106ae912f7bec718feb3f8ec607559bb /drivers/sbus/char/flash.c
parent162500b3a3ff39d941d29db49b41a16667ae44f0 (diff)
parent9b2a606d3898fcb2eedb6faded3bb37549590ac4 (diff)
Merge branches 'gemini' and 'misc' into devel
Diffstat (limited to 'drivers/sbus/char/flash.c')
-rw-r--r--drivers/sbus/char/flash.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 41083472ff4f..368d66294d83 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -7,7 +7,6 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/miscdevice.h> 9#include <linux/miscdevice.h>
10#include <linux/slab.h>
11#include <linux/fcntl.h> 10#include <linux/fcntl.h>
12#include <linux/poll.h> 11#include <linux/poll.h>
13#include <linux/init.h> 12#include <linux/init.h>
@@ -106,9 +105,9 @@ static ssize_t
106flash_read(struct file * file, char __user * buf, 105flash_read(struct file * file, char __user * buf,
107 size_t count, loff_t *ppos) 106 size_t count, loff_t *ppos)
108{ 107{
109 unsigned long p = file->f_pos; 108 loff_t p = *ppos;
110 int i; 109 int i;
111 110
112 if (count > flash.read_size - p) 111 if (count > flash.read_size - p)
113 count = flash.read_size - p; 112 count = flash.read_size - p;
114 113
@@ -119,7 +118,7 @@ flash_read(struct file * file, char __user * buf,
119 buf++; 118 buf++;
120 } 119 }
121 120
122 file->f_pos += count; 121 *ppos += count;
123 return count; 122 return count;
124} 123}
125 124
@@ -163,7 +162,7 @@ static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
163static int __devinit flash_probe(struct of_device *op, 162static int __devinit flash_probe(struct of_device *op,
164 const struct of_device_id *match) 163 const struct of_device_id *match)
165{ 164{
166 struct device_node *dp = op->node; 165 struct device_node *dp = op->dev.of_node;
167 struct device_node *parent; 166 struct device_node *parent;
168 167
169 parent = dp->parent; 168 parent = dp->parent;
@@ -185,7 +184,7 @@ static int __devinit flash_probe(struct of_device *op,
185 flash.busy = 0; 184 flash.busy = 0;
186 185
187 printk(KERN_INFO "%s: OBP Flash, RD %lx[%lx] WR %lx[%lx]\n", 186 printk(KERN_INFO "%s: OBP Flash, RD %lx[%lx] WR %lx[%lx]\n",
188 op->node->full_name, 187 op->dev.of_node->full_name,
189 flash.read_base, flash.read_size, 188 flash.read_base, flash.read_size,
190 flash.write_base, flash.write_size); 189 flash.write_base, flash.write_size);
191 190
@@ -208,8 +207,11 @@ static const struct of_device_id flash_match[] = {
208MODULE_DEVICE_TABLE(of, flash_match); 207MODULE_DEVICE_TABLE(of, flash_match);
209 208
210static struct of_platform_driver flash_driver = { 209static struct of_platform_driver flash_driver = {
211 .name = "flash", 210 .driver = {
212 .match_table = flash_match, 211 .name = "flash",
212 .owner = THIS_MODULE,
213 .of_match_table = flash_match,
214 },
213 .probe = flash_probe, 215 .probe = flash_probe,
214 .remove = __devexit_p(flash_remove), 216 .remove = __devexit_p(flash_remove),
215}; 217};